1 #include <lib/base/message.h>
2 #include <lib/service/iservice.h>
5 class eStaticServiceMP3Info;
7 class eServiceFactoryMerlinMP3Player: public iServiceHandler
9 DECLARE_REF(eServiceFactoryMerlinMP3Player);
11 eServiceFactoryMerlinMP3Player();
12 virtual ~eServiceFactoryMerlinMP3Player();
16 RESULT play(const eServiceReference &, ePtr<iPlayableService> &ptr);
17 RESULT record(const eServiceReference &, ePtr<iRecordableService> &ptr);
18 RESULT list(const eServiceReference &, ePtr<iListableService> &ptr);
19 RESULT info(const eServiceReference &, ePtr<iStaticServiceInformation> &ptr);
20 RESULT offlineOperations(const eServiceReference &, ePtr<iServiceOfflineOperations> &ptr);
22 ePtr<eStaticServiceMP3Info> m_service_info;
25 class eStaticServiceMP3Info: public iStaticServiceInformation
27 DECLARE_REF(eStaticServiceMP3Info);
28 friend class eServiceFactoryMerlinMP3Player;
29 eStaticServiceMP3Info();
31 RESULT getName(const eServiceReference &ref, std::string &name);
32 int getLength(const eServiceReference &ref);
35 typedef struct _GstElement GstElement;
37 class eServiceMerlinMP3Player: public iPlayableService, public iPauseableService,
38 public iServiceInformation, public iSeekableService, public Object
40 DECLARE_REF(eServiceMerlinMP3Player);
42 virtual ~eServiceMerlinMP3Player();
45 RESULT connectEvent(const Slot2<void,iPlayableService*,int> &event, ePtr<eConnection> &connection);
48 RESULT setTarget(int target);
50 RESULT pause(ePtr<iPauseableService> &ptr);
51 RESULT setSlowMotion(int ratio);
52 RESULT setFastForward(int ratio);
54 RESULT seek(ePtr<iSeekableService> &ptr);
56 RESULT audioChannel(ePtr<iAudioChannelSelection> &ptr) { ptr = 0; return 0; };
57 RESULT audioTracks(ePtr<iAudioTrackSelection> &ptr) { ptr = 0; return 0; };
58 RESULT frontendInfo(ePtr<iFrontendInformation> &ptr) { ptr = 0; return -1; };
59 RESULT subServices(ePtr<iSubserviceList> &ptr) { ptr = 0; return -1; };
60 RESULT timeshift(ePtr<iTimeshiftService> &ptr) { ptr = 0; return -1; };
61 RESULT cueSheet(ePtr<iCueSheet> &ptr) { ptr = 0; return -1; };
62 RESULT subtitle(ePtr<iSubtitleOutput> &ptr) { ptr = 0; return -1; };
63 RESULT audioDelay(ePtr<iAudioDelay> &ptr) { ptr = 0; return -1; };
64 RESULT rdsDecoder(ePtr<iRdsDecoder> &ptr) { ptr = 0; return -1; };
65 RESULT stream(ePtr<iStreamableService> &ptr) { ptr = 0; return -1; };
66 RESULT streamed(ePtr<iStreamedService> &ptr) { ptr = 0; return -1; };
67 RESULT keys(ePtr<iServiceKeys> &ptr) { ptr = 0; return -1; };
73 RESULT info(ePtr<iServiceInformation>&);
76 RESULT getLength(pts_t &SWIG_OUTPUT);
77 RESULT seekTo(pts_t to);
78 RESULT seekRelative(int direction, pts_t to);
79 RESULT getPlayPosition(pts_t &SWIG_OUTPUT);
80 RESULT setTrickmode(int trick);
81 RESULT isCurrentlySeekable();
83 // iServiceInformation
84 RESULT getName(std::string &name);
86 std::string getInfoString(int w);
88 friend class eServiceFactoryMerlinMP3Player;
89 eServiceReference m_ref;
90 std::string m_filename;
91 eServiceMerlinMP3Player(eServiceReference ref);
92 Signal2<void,iPlayableService*,int> m_event;
95 stIdle, stRunning, stStopped,
98 GstElement *m_gst_pipeline;
99 eFixedMessagePump<int> m_pump;
101 void gstBusCall(GstBus *bus, GstMessage *msg);
102 static GstBusSyncReply gstBusSyncHandler(GstBus *bus, GstMessage *message, gpointer user_data);
103 void gstPoll(const int&);