diff options
Diffstat (limited to 'cmpcj/src/de/schwarzrot/media')
6 files changed, 99 insertions, 31 deletions
diff --git a/cmpcj/src/de/schwarzrot/media/domain/Config.java b/cmpcj/src/de/schwarzrot/media/domain/Config.java index d273972..826ad55 100644 --- a/cmpcj/src/de/schwarzrot/media/domain/Config.java +++ b/cmpcj/src/de/schwarzrot/media/domain/Config.java @@ -1,25 +1,25 @@ /** * ======================== legal notice ====================== * - * File: Config.java - * Created: 13. June 2012, 04:57 - * 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: Config.java Created: 13. June 2012, 04:57 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 * * -------------------------------------------------------------- */ @@ -79,6 +79,11 @@ public class Config { } + public boolean isUseDarkStyle() { + return useDarkStyle; + } + + public void putPlayer(Media.SupportedMediaType type, PlayerDefinition pd) { playerMap.put(type, pd); } @@ -118,9 +123,15 @@ public class Config { this.posY = posY; } + + public void setUseDarkStyle(boolean useDarkStyle) { + this.useDarkStyle = useDarkStyle; + } + private List<MediaServer> knownServers; private Map<Media.SupportedMediaType, PlayerDefinition> playerMap; private boolean debug; + private boolean useDarkStyle; private int posX; private int posY; private int mainWidth; diff --git a/cmpcj/src/de/schwarzrot/media/service/AbstractMediaChangeCommand.java b/cmpcj/src/de/schwarzrot/media/service/AbstractMediaChangeCommand.java new file mode 100644 index 0000000..de6bf8d --- /dev/null +++ b/cmpcj/src/de/schwarzrot/media/service/AbstractMediaChangeCommand.java @@ -0,0 +1,25 @@ +package de.schwarzrot.media.service; + + +import de.schwarzrot.media.domain.AbstractMediaNode; + + +public abstract class AbstractMediaChangeCommand { + protected AbstractMediaChangeCommand(AbstractMediaNode media, String type) { + mediaNode = media; + commandType = type; + } + + + public String getCommandType() { + return commandType; + } + + + public AbstractMediaNode getMediaNode() { + return mediaNode; + } + + private AbstractMediaNode mediaNode; + private String commandType; +} diff --git a/cmpcj/src/de/schwarzrot/media/service/ChangeMediaCommand.java b/cmpcj/src/de/schwarzrot/media/service/ChangeMediaCommand.java new file mode 100644 index 0000000..da23f8b --- /dev/null +++ b/cmpcj/src/de/schwarzrot/media/service/ChangeMediaCommand.java @@ -0,0 +1,11 @@ +package de.schwarzrot.media.service; + + +import de.schwarzrot.media.domain.AbstractMediaNode; + + +public class ChangeMediaCommand extends AbstractMediaChangeCommand { + public ChangeMediaCommand(AbstractMediaNode mediaNode) { + super(mediaNode, "M"); + } +} diff --git a/cmpcj/src/de/schwarzrot/media/service/CreateMediaCommand.java b/cmpcj/src/de/schwarzrot/media/service/CreateMediaCommand.java new file mode 100644 index 0000000..745d2ce --- /dev/null +++ b/cmpcj/src/de/schwarzrot/media/service/CreateMediaCommand.java @@ -0,0 +1,11 @@ +package de.schwarzrot.media.service; + + +import de.schwarzrot.media.domain.AbstractMediaNode; + + +public class CreateMediaCommand extends AbstractMediaChangeCommand { + public CreateMediaCommand(AbstractMediaNode mediaNode) { + super(mediaNode, "C"); + } +} diff --git a/cmpcj/src/de/schwarzrot/media/service/MediaFactory.java b/cmpcj/src/de/schwarzrot/media/service/MediaFactory.java index ff31822..3ee711d 100644 --- a/cmpcj/src/de/schwarzrot/media/service/MediaFactory.java +++ b/cmpcj/src/de/schwarzrot/media/service/MediaFactory.java @@ -1,25 +1,25 @@ /** * ======================== legal notice ====================== * - * File: MediaFactory.java - * Created: 13. June 2012, 04:57 - * 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: MediaFactory.java Created: 13. June 2012, 04:57 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 * * -------------------------------------------------------------- */ @@ -50,10 +50,9 @@ public class MediaFactory { } - //TODO: - // here we can't rely on file system information. + //XXX: here we can't rely on file system information. // may be we got files from remote system ... - // so instead to use lookahead for multifile movies, we need to go back + // so instead of using lookahead for multifile movies, we need to go back // from keyfiles public Media createMedia(File mayBeMedia) { if (!mayBeMedia.getAbsolutePath().startsWith(prefix)) diff --git a/cmpcj/src/de/schwarzrot/media/service/RemoveMediaCommand.java b/cmpcj/src/de/schwarzrot/media/service/RemoveMediaCommand.java new file mode 100644 index 0000000..a4f0854 --- /dev/null +++ b/cmpcj/src/de/schwarzrot/media/service/RemoveMediaCommand.java @@ -0,0 +1,11 @@ +package de.schwarzrot.media.service; + + +import de.schwarzrot.media.domain.AbstractMediaNode; + + +public class RemoveMediaCommand extends AbstractMediaChangeCommand { + public RemoveMediaCommand(AbstractMediaNode mediaNode) { + super(mediaNode, "R"); + } +} |