add some comments
[enigma2.git] / lib / service / servicemp3.h
1 #ifndef __servicemp3_h
2 #define __servicemp3_h
3
4 #include <lib/service/iservice.h>
5
6 class eStaticServiceMP3Info;
7
8 class eServiceFactoryMP3: public iServiceHandler
9 {
10 DECLARE_REF(eServiceFactoryMP3);
11 public:
12         eServiceFactoryMP3();
13         virtual ~eServiceFactoryMP3();
14         enum { id = 0x1001 };
15
16                 // iServiceHandler
17         RESULT play(const eServiceReference &, ePtr<iPlayableService> &ptr);
18         RESULT record(const eServiceReference &, ePtr<iRecordableService> &ptr);
19         RESULT list(const eServiceReference &, ePtr<iListableService> &ptr);
20         RESULT info(const eServiceReference &, ePtr<iStaticServiceInformation> &ptr);
21         RESULT offlineOperations(const eServiceReference &, ePtr<iServiceOfflineOperations> &ptr);
22 private:
23         ePtr<eStaticServiceMP3Info> m_service_info;
24 };
25
26 class eStaticServiceMP3Info: public iStaticServiceInformation
27 {
28         DECLARE_REF(eStaticServiceMP3Info);
29         friend class eServiceFactoryMP3;
30         eStaticServiceMP3Info();
31 public:
32         RESULT getName(const eServiceReference &ref, std::string &name);
33         int getLength(const eServiceReference &ref);
34 };
35
36 class eServiceMP3: public iPlayableService, public iPauseableService, public iServiceInformation, public Object
37 {
38 DECLARE_REF(eServiceMP3);
39 private:
40         friend class eServiceFactoryMP3;
41         std::string filename;
42         eServiceMP3(const char *filename);      
43         eTimer test;
44         void test_end();
45         Signal2<void,iPlayableService*,int> m_event;
46         enum
47         {
48                 stIdle, stRunning, stStopped,
49         };
50         int m_state;
51 public:
52         virtual ~eServiceMP3();
53
54                 // iPlayableService
55         RESULT connectEvent(const Slot2<void,iPlayableService*,int> &event, ePtr<eConnection> &connection);
56         RESULT start();
57         RESULT stop();
58         RESULT pause(ePtr<iPauseableService> &ptr);
59         RESULT seek(ePtr<iSeekableService> &ptr);
60
61                 // iPausableService
62         RESULT pause();
63         RESULT unpause();
64         
65         RESULT info(ePtr<iServiceInformation>&);
66         
67                 // iServiceInformation
68         RESULT getName(std::string &name);
69 };
70
71 #endif