summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgeronimo <geronimo013@gmx.de>2012-08-02 07:30:50 (GMT)
committergeronimo <geronimo013@gmx.de>2012-08-02 07:30:50 (GMT)
commitc7d67f443bdfe842c2e356d4edbe345338e3e08d (patch)
tree9be157c84c35305cafd2f53d347b34ac0200b5a2
parentadb7d83292e1502ca7c21a123b104412cb22d160 (diff)
downloadcmp-c7d67f443bdfe842c2e356d4edbe345338e3e08d.tar.gz
cmp-c7d67f443bdfe842c2e356d4edbe345338e3e08d.tar.bz2
patched client to support the new media types and display extended items
-rw-r--r--cmpcj/res/images/folder_black_i_dvd.pngbin0 -> 128700 bytes
-rw-r--r--cmpcj/res/images/folder_black_i_movies.pngbin0 -> 133715 bytes
-rw-r--r--cmpcj/res/images/folder_black_i_vdr.pngbin0 -> 140435 bytes
-rw-r--r--cmpcj/res/images/folder_black_i_vdr_old.pngbin0 -> 181800 bytes
-rw-r--r--cmpcj/src/de/schwarzrot/cmpc/domain/Media.java38
-rw-r--r--cmpcj/src/de/schwarzrot/cmpc/ui/MediaClient.java40
-rw-r--r--cmpcj/src/de/schwarzrot/cmpc/util/MediaTableFormat.java60
-rw-r--r--cmpcj/src/de/schwarzrot/cmpc/util/MediaTextFilterator.java29
-rw-r--r--cmpcj/src/de/schwarzrot/cmpc/util/MediaTypeSelect.java34
-rw-r--r--cmps/serverlib/src/JSonListAssembler.cc2
-rw-r--r--libs/mediaScan/src/Movie.cc2
11 files changed, 141 insertions, 64 deletions
diff --git a/cmpcj/res/images/folder_black_i_dvd.png b/cmpcj/res/images/folder_black_i_dvd.png
new file mode 100644
index 0000000..2b4294c
--- /dev/null
+++ b/cmpcj/res/images/folder_black_i_dvd.png
Binary files differ
diff --git a/cmpcj/res/images/folder_black_i_movies.png b/cmpcj/res/images/folder_black_i_movies.png
new file mode 100644
index 0000000..e5ed555
--- /dev/null
+++ b/cmpcj/res/images/folder_black_i_movies.png
Binary files differ
diff --git a/cmpcj/res/images/folder_black_i_vdr.png b/cmpcj/res/images/folder_black_i_vdr.png
new file mode 100644
index 0000000..129b733
--- /dev/null
+++ b/cmpcj/res/images/folder_black_i_vdr.png
Binary files differ
diff --git a/cmpcj/res/images/folder_black_i_vdr_old.png b/cmpcj/res/images/folder_black_i_vdr_old.png
new file mode 100644
index 0000000..4cb2584
--- /dev/null
+++ b/cmpcj/res/images/folder_black_i_vdr_old.png
Binary files differ
diff --git a/cmpcj/src/de/schwarzrot/cmpc/domain/Media.java b/cmpcj/src/de/schwarzrot/cmpc/domain/Media.java
index a254192..a7e575f 100644
--- a/cmpcj/src/de/schwarzrot/cmpc/domain/Media.java
+++ b/cmpcj/src/de/schwarzrot/cmpc/domain/Media.java
@@ -36,6 +36,16 @@ public class Media {
};
+ public String getFormat() {
+ return format;
+ }
+
+
+ public int getHeight() {
+ return height;
+ }
+
+
public String getName() {
return name;
}
@@ -56,6 +66,26 @@ public class Media {
}
+ public int getWidth() {
+ return width;
+ }
+
+
+ public boolean isHD() {
+ return height > 576;
+ }
+
+
+ public void setFormat(String format) {
+ this.format = format;
+ }
+
+
+ public void setHeight(int height) {
+ this.height = height;
+ }
+
+
public void setName(String name) {
this.name = name;
}
@@ -96,8 +126,16 @@ public class Media {
this.type = SupportedMediaType.Invalid;
}
+
+ public void setWidth(int width) {
+ this.width = width;
+ }
+
private String name;
private SupportedMediaType type;
+ private String format;
private String path;
private String search;
+ private int width;
+ private int height;
}
diff --git a/cmpcj/src/de/schwarzrot/cmpc/ui/MediaClient.java b/cmpcj/src/de/schwarzrot/cmpc/ui/MediaClient.java
index 9237106..70da17f 100644
--- a/cmpcj/src/de/schwarzrot/cmpc/ui/MediaClient.java
+++ b/cmpcj/src/de/schwarzrot/cmpc/ui/MediaClient.java
@@ -1,25 +1,25 @@
/**
* ======================== legal notice ======================
*
- * File: MediaClient.java
- * Created:
- * Author: <a href="mailto:geronimo013@gmx.de">Geronimo</a>
- * Project: cmpc - a java frontend (client) part of compound media player
- * uses external players to play the media
+ * File: MediaClient.java Created: Author: <a
+ * href="mailto:geronimo013@gmx.de">Geronimo</a> Project: cmpc - a java frontend
+ * (client) part of compound media player uses external players to play the
+ * media
*
* CMP - compound media player
*
- * is a client/server mediaplayer intended to play any media from any workstation
- * without the need to export or mount shares. cmps is an easy to use backend
- * with a (ready to use) HTML-interface. Additionally the backend supports
- * authentication via HTTP-digest authorization.
- * cmpc is a client with vdr-like osd-menues.
+ * is a client/server mediaplayer intended to play any media from any
+ * workstation without the need to export or mount shares. cmps is an easy to
+ * use backend with a (ready to use) HTML-interface. Additionally the backend
+ * supports authentication via HTTP-digest authorization. cmpc is a client with
+ * vdr-like osd-menues.
*
- * Copyright (c) 2012 Reinhard Mantey, some rights reserved!
- * published under Creative Commons by-sa
- * For details see http://creativecommons.org/licenses/by-sa/3.0/
+ * Copyright (c) 2012 Reinhard Mantey, some rights reserved! published under
+ * Creative Commons by-sa For details see
+ * http://creativecommons.org/licenses/by-sa/3.0/
*
- * The cmp project's homepage is at http://projects.vdr-developer.org/projects/cmp
+ * The cmp project's homepage is at
+ * http://projects.vdr-developer.org/projects/cmp
*
* --------------------------------------------------------------
*/
@@ -165,8 +165,8 @@ public class MediaClient extends JComponent implements MediaClientExecutor {
JTextField filterEdit = new JTextField(30);
FilterList<Media> textFilteredMedia = new FilterList<Media>(filteredMedias,
new TextComponentMatcherEditor<Media>(filterEdit, new MediaTextFilterator()));
- DefaultEventTableModel<Media> mediaTableModel = new DefaultEventTableModel<Media>(textFilteredMedia,
- new MediaTableFormat());
+ MediaTableFormat tf = new MediaTableFormat();
+ DefaultEventTableModel<Media> mediaTableModel = new DefaultEventTableModel<Media>(textFilteredMedia, tf);
JTable mediaJTable = new JTable(mediaTableModel);
@SuppressWarnings({ "unused", "rawtypes" })
TableComparatorChooser tableSorter = TableComparatorChooser.install(mediaJTable, sortedMedias,
@@ -189,7 +189,13 @@ public class MediaClient extends JComponent implements MediaClientExecutor {
});
mediaTypesScrollPane.setPreferredSize(new Dimension(100, 100));
mediaTypesScrollPane.setBackground(Color.BLACK);
- mediaJTable.getColumnModel().getColumn(0).setMaxWidth(80);
+ int mx = mediaJTable.getColumnModel().getColumnCount();
+ for (int i = 0; i < mx; ++i) {
+ int cw = tf.getColumnWidth(i);
+
+ if (cw > 0)
+ mediaJTable.getColumnModel().getColumn(i).setMaxWidth(cw);
+ }
mediaJTable.getColumnModel().getColumn(0).setCellRenderer(new DefaultTableCellRenderer());
mediaJTable.getColumnModel().getColumn(1).setCellRenderer(new DefaultTableCellRenderer());
mediaJTable.addMouseListener(new MediaExecutor(mediaJTable, textFilteredMedia, this));
diff --git a/cmpcj/src/de/schwarzrot/cmpc/util/MediaTableFormat.java b/cmpcj/src/de/schwarzrot/cmpc/util/MediaTableFormat.java
index 7fa5452..d427e83 100644
--- a/cmpcj/src/de/schwarzrot/cmpc/util/MediaTableFormat.java
+++ b/cmpcj/src/de/schwarzrot/cmpc/util/MediaTableFormat.java
@@ -1,25 +1,25 @@
/**
* ======================== legal notice ======================
*
- * File: MediaTableFormat.java
- * Created:
- * Author: <a href="mailto:geronimo013@gmx.de">Geronimo</a>
- * Project: cmpc - a java frontend (client) part of compound media player
- * uses external players to play the media
+ * File: MediaTableFormat.java Created: Author: <a
+ * href="mailto:geronimo013@gmx.de">Geronimo</a> Project: cmpc - a java frontend
+ * (client) part of compound media player uses external players to play the
+ * media
*
* CMP - compound media player
*
- * is a client/server mediaplayer intended to play any media from any workstation
- * without the need to export or mount shares. cmps is an easy to use backend
- * with a (ready to use) HTML-interface. Additionally the backend supports
- * authentication via HTTP-digest authorization.
- * cmpc is a client with vdr-like osd-menues.
+ * is a client/server mediaplayer intended to play any media from any
+ * workstation without the need to export or mount shares. cmps is an easy to
+ * use backend with a (ready to use) HTML-interface. Additionally the backend
+ * supports authentication via HTTP-digest authorization. cmpc is a client with
+ * vdr-like osd-menues.
*
- * Copyright (c) 2012 Reinhard Mantey, some rights reserved!
- * published under Creative Commons by-sa
- * For details see http://creativecommons.org/licenses/by-sa/3.0/
+ * Copyright (c) 2012 Reinhard Mantey, some rights reserved! published under
+ * Creative Commons by-sa For details see
+ * http://creativecommons.org/licenses/by-sa/3.0/
*
- * The cmp project's homepage is at http://projects.vdr-developer.org/projects/cmp
+ * The cmp project's homepage is at
+ * http://projects.vdr-developer.org/projects/cmp
*
* --------------------------------------------------------------
*/
@@ -33,7 +33,7 @@ import de.schwarzrot.cmpc.domain.Media;
public class MediaTableFormat implements TableFormat<Media> {
@Override
public int getColumnCount() {
- return 2;
+ return 5;
}
@@ -43,6 +43,12 @@ public class MediaTableFormat implements TableFormat<Media> {
case 0:
return "Type";
case 1:
+ return "Format";
+ case 2:
+ return "Width";
+ case 3:
+ return "Height";
+ case 4:
return "Name";
default:
throw new IllegalStateException();
@@ -56,9 +62,33 @@ public class MediaTableFormat implements TableFormat<Media> {
case 0:
return m.getType();
case 1:
+ return m.getFormat();
+ case 2:
+ return m.getWidth();
+ case 3:
+ return m.getHeight();
+ case 4:
return m.getName();
default:
throw new IllegalStateException();
}
}
+
+
+ public int getColumnWidth(int column) {
+ switch (column) {
+ case 0:
+ return 80;
+ case 1:
+ return 100;
+ case 2:
+ return 60;
+ case 3:
+ return 60;
+ case 4:
+ return -1;
+ default:
+ throw new IllegalStateException();
+ }
+ }
}
diff --git a/cmpcj/src/de/schwarzrot/cmpc/util/MediaTextFilterator.java b/cmpcj/src/de/schwarzrot/cmpc/util/MediaTextFilterator.java
index e41c81f..aa035d9 100644
--- a/cmpcj/src/de/schwarzrot/cmpc/util/MediaTextFilterator.java
+++ b/cmpcj/src/de/schwarzrot/cmpc/util/MediaTextFilterator.java
@@ -1,25 +1,25 @@
/**
* ======================== legal notice ======================
*
- * File: MediaTextFilterator.java
- * Created:
- * Author: <a href="mailto:geronimo013@gmx.de">Geronimo</a>
- * Project: cmpc - a java frontend (client) part of compound media player
- * uses external players to play the media
+ * File: MediaTextFilterator.java Created: Author: <a
+ * href="mailto:geronimo013@gmx.de">Geronimo</a> Project: cmpc - a java frontend
+ * (client) part of compound media player uses external players to play the
+ * media
*
* CMP - compound media player
*
- * is a client/server mediaplayer intended to play any media from any workstation
- * without the need to export or mount shares. cmps is an easy to use backend
- * with a (ready to use) HTML-interface. Additionally the backend supports
- * authentication via HTTP-digest authorization.
- * cmpc is a client with vdr-like osd-menues.
+ * is a client/server mediaplayer intended to play any media from any
+ * workstation without the need to export or mount shares. cmps is an easy to
+ * use backend with a (ready to use) HTML-interface. Additionally the backend
+ * supports authentication via HTTP-digest authorization. cmpc is a client with
+ * vdr-like osd-menues.
*
- * Copyright (c) 2012 Reinhard Mantey, some rights reserved!
- * published under Creative Commons by-sa
- * For details see http://creativecommons.org/licenses/by-sa/3.0/
+ * Copyright (c) 2012 Reinhard Mantey, some rights reserved! published under
+ * Creative Commons by-sa For details see
+ * http://creativecommons.org/licenses/by-sa/3.0/
*
- * The cmp project's homepage is at http://projects.vdr-developer.org/projects/cmp
+ * The cmp project's homepage is at
+ * http://projects.vdr-developer.org/projects/cmp
*
* --------------------------------------------------------------
*/
@@ -36,5 +36,6 @@ public class MediaTextFilterator implements TextFilterator<Media> {
public void getFilterStrings(List<String> baseList, Media m) {
baseList.add(m.getName());
baseList.add(m.getSearch());
+ baseList.add(m.getFormat());
}
}
diff --git a/cmpcj/src/de/schwarzrot/cmpc/util/MediaTypeSelect.java b/cmpcj/src/de/schwarzrot/cmpc/util/MediaTypeSelect.java
index 033ee53..24cd506 100644
--- a/cmpcj/src/de/schwarzrot/cmpc/util/MediaTypeSelect.java
+++ b/cmpcj/src/de/schwarzrot/cmpc/util/MediaTypeSelect.java
@@ -1,25 +1,25 @@
/**
* ======================== legal notice ======================
*
- * File: MediaTypeSelect.java
- * Created:
- * Author: <a href="mailto:geronimo013@gmx.de">Geronimo</a>
- * Project: cmpc - a java frontend (client) part of compound media player
- * uses external players to play the media
+ * File: MediaTypeSelect.java Created: Author: <a
+ * href="mailto:geronimo013@gmx.de">Geronimo</a> Project: cmpc - a java frontend
+ * (client) part of compound media player uses external players to play the
+ * media
*
* CMP - compound media player
*
- * is a client/server mediaplayer intended to play any media from any workstation
- * without the need to export or mount shares. cmps is an easy to use backend
- * with a (ready to use) HTML-interface. Additionally the backend supports
- * authentication via HTTP-digest authorization.
- * cmpc is a client with vdr-like osd-menues.
+ * is a client/server mediaplayer intended to play any media from any
+ * workstation without the need to export or mount shares. cmps is an easy to
+ * use backend with a (ready to use) HTML-interface. Additionally the backend
+ * supports authentication via HTTP-digest authorization. cmpc is a client with
+ * vdr-like osd-menues.
*
- * Copyright (c) 2012 Reinhard Mantey, some rights reserved!
- * published under Creative Commons by-sa
- * For details see http://creativecommons.org/licenses/by-sa/3.0/
+ * Copyright (c) 2012 Reinhard Mantey, some rights reserved! published under
+ * Creative Commons by-sa For details see
+ * http://creativecommons.org/licenses/by-sa/3.0/
*
- * The cmp project's homepage is at http://projects.vdr-developer.org/projects/cmp
+ * The cmp project's homepage is at
+ * http://projects.vdr-developer.org/projects/cmp
*
* --------------------------------------------------------------
*/
@@ -141,7 +141,9 @@ public class MediaTypeSelect extends AbstractMatcherEditor<Media> implements Lis
private static final String[] iconFiles;
static {
iconFiles = new String[] { "images/folder_black.png", "images/folder_black_music.png",
- "images/folder_black_movies.png", "images/folder_black_dvd.png", "images/folder_black_vdr_old.png",
- "images/folder_black_vdr.png", "images/folder_black_photos.png", "images/folder_black.png" };
+ "images/folder_black_movies.png", "images/folder_black_i_movies.png", "images/folder_black_dvd.png",
+ "images/folder_black_i_dvd.png", "images/folder_black_vdr_old.png",
+ "images/folder_black_i_vdr_old.png", "images/folder_black_vdr.png", "images/folder_black_i_vdr.png",
+ "images/folder_black_photos.png", "images/folder_black.png" };
}
}
diff --git a/cmps/serverlib/src/JSonListAssembler.cc b/cmps/serverlib/src/JSonListAssembler.cc
index bdeb7b9..bae15c4 100644
--- a/cmps/serverlib/src/JSonListAssembler.cc
+++ b/cmps/serverlib/src/JSonListAssembler.cc
@@ -64,7 +64,7 @@ bool cJSonListAssembler::AddElement(cStringBuilder &sb, void *ListElement, bool
writer->Object();
writer->Key("name").Value(m->Name());
writer->Key("type").Value(m->MediaType());
- writer->Key("format").Value(m->Format());
+ writer->Key("format").Value(m->Format() ? m->Format() : " ");
writer->Key("width").Value(m->Width());
writer->Key("height").Value(m->Height());
writer->Key("path").Value(m->URI());
diff --git a/libs/mediaScan/src/Movie.cc b/libs/mediaScan/src/Movie.cc
index 51d1ff9..19fc629 100644
--- a/libs/mediaScan/src/Movie.cc
+++ b/libs/mediaScan/src/Movie.cc
@@ -90,7 +90,7 @@ bool cMovie::NeedsFurtherScan(void) const
}
void cMovie::SetFormat(const char* Format) {
- if (!strcmp("Matroska", Format) || !strcmp("Flash Video", Format)
+ if (!strncmp("Matroska", Format, 8) || !strcmp("Flash Video", Format) || !strcmp("AVI", Format)
|| !strcmp("MPEG-PS", Format) || !strcmp("MPEG-TS", Format) || !strcmp("MPEG-PES", Format))
return; // skip containers
cAbstractMedia::SetFormat(Format);