5 #include <lib/base/message.h>
6 #include <lib/service/iservice.h>
9 class eStaticServiceMP3Info;
11 class eServiceFactoryMP3: public iServiceHandler
13 DECLARE_REF(eServiceFactoryMP3);
16 virtual ~eServiceFactoryMP3();
20 RESULT play(const eServiceReference &, ePtr<iPlayableService> &ptr);
21 RESULT record(const eServiceReference &, ePtr<iRecordableService> &ptr);
22 RESULT list(const eServiceReference &, ePtr<iListableService> &ptr);
23 RESULT info(const eServiceReference &, ePtr<iStaticServiceInformation> &ptr);
24 RESULT offlineOperations(const eServiceReference &, ePtr<iServiceOfflineOperations> &ptr);
26 ePtr<eStaticServiceMP3Info> m_service_info;
29 class eStaticServiceMP3Info: public iStaticServiceInformation
31 DECLARE_REF(eStaticServiceMP3Info);
32 friend class eServiceFactoryMP3;
33 eStaticServiceMP3Info();
35 RESULT getName(const eServiceReference &ref, std::string &name);
36 int getLength(const eServiceReference &ref);
39 typedef struct _GstElement GstElement;
41 class eServiceMP3: public iPlayableService, public iPauseableService,
42 public iServiceInformation, public iSeekableService, public Object
44 DECLARE_REF(eServiceMP3);
46 virtual ~eServiceMP3();
49 RESULT connectEvent(const Slot2<void,iPlayableService*,int> &event, ePtr<eConnection> &connection);
52 RESULT pause(ePtr<iPauseableService> &ptr);
53 RESULT setSlowMotion(int ratio);
54 RESULT setFastForward(int ratio);
56 RESULT seek(ePtr<iSeekableService> &ptr);
58 // not implemented (yet)
59 RESULT audioTracks(ePtr<iAudioTrackSelection> &ptr) { ptr = 0; return -1; }
60 RESULT frontendStatusInfo(ePtr<iFrontendStatusInformation> &ptr) { ptr = 0; return -1; }
61 RESULT subServices(ePtr<iSubserviceList> &ptr) { ptr = 0; return -1; }
62 RESULT timeshift(ePtr<iTimeshiftService> &ptr) { ptr = 0; return -1; }
63 RESULT cueSheet(ePtr<iCueSheet>& ptr) { ptr = 0; return -1; }
69 RESULT info(ePtr<iServiceInformation>&);
72 RESULT getLength(pts_t &SWIG_OUTPUT);
73 RESULT seekTo(pts_t to);
74 RESULT seekRelative(int direction, pts_t to);
75 RESULT getPlayPosition(pts_t &SWIG_OUTPUT);
76 RESULT setTrickmode(int trick);
77 RESULT isCurrentlySeekable();
79 // iServiceInformation
80 RESULT getName(std::string &name);
82 std::string getInfoString(int w);
84 friend class eServiceFactoryMP3;
85 std::string m_filename;
86 eServiceMP3(const char *filename);
87 Signal2<void,iPlayableService*,int> m_event;
90 stIdle, stRunning, stStopped,
93 GstElement *m_gst_pipeline, *m_gst_audio;
94 GstTagList *m_stream_tags;
95 eFixedMessagePump<int> m_pump;
97 void gstBusCall(GstBus *bus, GstMessage *msg);
98 static GstBusSyncReply gstBusSyncHandler(GstBus *bus, GstMessage *message, gpointer user_data);
99 static void gstCBnewPad(GstElement *decodebin, GstPad *pad, gboolean last, gpointer data);
100 void gstPoll(const int&);