-rw-r--r-- | noncore/multimedia/opieplayer2/lib.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp index 4b13f00..123ca91 100644 --- a/noncore/multimedia/opieplayer2/lib.cpp +++ b/noncore/multimedia/opieplayer2/lib.cpp | |||
@@ -1,112 +1,117 @@ | |||
1 | 1 | ||
2 | #include <stdio.h> | 2 | #include <stdio.h> |
3 | #include <stdlib.h> | 3 | #include <stdlib.h> |
4 | //#include <qpe/qpeapplication.h> | 4 | //#include <qpe/qpeapplication.h> |
5 | 5 | ||
6 | #include <qfile.h> | 6 | #include <qfile.h> |
7 | 7 | ||
8 | #include "frame.h" | 8 | #include "frame.h" |
9 | #include "lib.h" | 9 | #include "lib.h" |
10 | 10 | ||
11 | 11 | ||
12 | 12 | extern "C" { | |
13 | vo_driver_t* init_video_out_plugin( config_values_t* conf, void* video); | ||
14 | } | ||
13 | 15 | ||
14 | using namespace XINE; | 16 | using namespace XINE; |
15 | 17 | ||
16 | Lib::Lib() { | 18 | Lib::Lib() { |
17 | printf("Lib"); | 19 | printf("Lib"); |
18 | QCString str( getenv("HOME") ); | 20 | QCString str( getenv("HOME") ); |
19 | str += "/Settings/opiexine.cf"; | 21 | str += "/Settings/opiexine.cf"; |
20 | // get the configuration | 22 | // get the configuration |
21 | m_config = xine_config_file_init( str.data() ); | 23 | m_config = xine_config_file_init( str.data() ); |
22 | 24 | ||
23 | // allocate oss for sound | 25 | // allocate oss for sound |
24 | // and fb for framebuffer | 26 | // and fb for framebuffer |
25 | m_audioOutput= xine_load_audio_output_plugin( m_config, "oss") ; | 27 | m_audioOutput= xine_load_audio_output_plugin( m_config, "oss") ; |
26 | if (m_audioOutput == NULL ) | 28 | if (m_audioOutput == NULL ) |
27 | printf("Failure\n"); | 29 | printf("Failure\n"); |
28 | else | 30 | else |
29 | printf("Success\n"); | 31 | printf("Success\n"); |
30 | 32 | ||
31 | 33 | ||
32 | // test code | 34 | // test code |
33 | m_videoOutput = xine_load_video_output_plugin(m_config, "fb", | 35 | m_videoOutput = xine_load_video_output_plugin(m_config, "fb", |
34 | VISUAL_TYPE_FB, | 36 | VISUAL_TYPE_FB, |
35 | 0 ); | 37 | 0 ); |
36 | 38 | ||
37 | char** files = xine_list_video_output_plugins(3); | 39 | char** files = xine_list_video_output_plugins(3); |
38 | char* out; | 40 | char* out; |
39 | int i = 0; | 41 | int i = 0; |
40 | while ( ( out = files[i] ) != 0 ) { | 42 | while ( ( out = files[i] ) != 0 ) { |
41 | printf("Audio %s\n", out ); | 43 | printf("Audio %s\n", out ); |
42 | i++; | 44 | i++; |
43 | } | 45 | } |
44 | m_xine = xine_init( m_videoOutput, | 46 | m_xine = xine_init( m_videoOutput, |
45 | m_audioOutput, | 47 | m_audioOutput, |
46 | m_config ); | 48 | m_config ); |
49 | // test loading | ||
50 | m_videoOutput = ::init_video_out_plugin( m_config, NULL ); | ||
47 | } | 51 | } |
48 | 52 | ||
49 | Lib::~Lib() { | 53 | Lib::~Lib() { |
50 | delete m_config; | 54 | delete m_config; |
51 | xine_exit( m_xine ); | 55 | xine_exit( m_xine ); |
52 | delete m_videoOutput; | 56 | delete m_videoOutput; |
53 | //delete m_audioOutput; | 57 | //delete m_audioOutput; |
54 | 58 | ||
55 | } | 59 | } |
56 | 60 | ||
57 | QCString Lib::version() { | 61 | QCString Lib::version() { |
58 | QCString str( xine_get_str_version() ); | 62 | QCString str( xine_get_str_version() ); |
59 | return str; | 63 | return str; |
60 | }; | 64 | }; |
61 | 65 | ||
62 | int Lib::majorVersion() { | 66 | int Lib::majorVersion() { |
63 | return xine_get_major_version(); | 67 | return xine_get_major_version(); |
64 | } | 68 | } |
65 | int Lib::minorVersion() { | 69 | int Lib::minorVersion() { |
66 | return xine_get_minor_version(); | 70 | return xine_get_minor_version(); |
67 | }; | 71 | }; |
72 | |||
68 | int Lib::subVersion() { | 73 | int Lib::subVersion() { |
69 | return xine_get_sub_version(); | 74 | return xine_get_sub_version(); |
70 | } | 75 | } |
71 | int Lib::play( const QString& fileName, | 76 | int Lib::play( const QString& fileName, |
72 | int startPos, | 77 | int startPos, |
73 | int start_time ) { | 78 | int start_time ) { |
74 | QString str = fileName; | 79 | QString str = fileName; |
75 | return xine_play( m_xine, QFile::encodeName(str.utf8() ).data(), | 80 | return xine_play( m_xine, QFile::encodeName(str.utf8() ).data(), |
76 | startPos, start_time); | 81 | startPos, start_time); |
77 | } | 82 | } |
78 | void Lib::stop() { | 83 | void Lib::stop() { |
79 | xine_stop(m_xine ); | 84 | xine_stop(m_xine ); |
80 | } | 85 | } |
81 | void Lib::pause(){ | 86 | void Lib::pause(){ |
82 | xine_set_speed( m_xine, SPEED_PAUSE ); | 87 | xine_set_speed( m_xine, SPEED_PAUSE ); |
83 | } | 88 | } |
84 | int Lib::speed() { | 89 | int Lib::speed() { |
85 | return xine_get_speed( m_xine ); | 90 | return xine_get_speed( m_xine ); |
86 | } | 91 | } |
87 | void Lib::setSpeed( int speed ) { | 92 | void Lib::setSpeed( int speed ) { |
88 | xine_set_speed( m_xine, speed ); | 93 | xine_set_speed( m_xine, speed ); |
89 | } | 94 | } |
90 | int Lib::status(){ | 95 | int Lib::status(){ |
91 | return xine_get_status( m_xine ); | 96 | return xine_get_status( m_xine ); |
92 | } | 97 | } |
93 | int Lib::currentPosition(){ | 98 | int Lib::currentPosition(){ |
94 | return xine_get_current_position( m_xine ); | 99 | return xine_get_current_position( m_xine ); |
95 | } | 100 | } |
96 | int Lib::currentTime() { | 101 | int Lib::currentTime() { |
97 | return xine_get_current_time( m_xine ); | 102 | return xine_get_current_time( m_xine ); |
98 | }; | 103 | }; |
99 | int Lib::length() { | 104 | int Lib::length() { |
100 | return xine_get_stream_length( m_xine ); | 105 | return xine_get_stream_length( m_xine ); |
101 | } | 106 | } |
102 | bool Lib::isSeekable() { | 107 | bool Lib::isSeekable() { |
103 | return xine_is_stream_seekable(m_xine); | 108 | return xine_is_stream_seekable(m_xine); |
104 | } | 109 | } |
105 | Frame Lib::currentFrame() { | 110 | Frame Lib::currentFrame() { |
106 | Frame frame; | 111 | Frame frame; |
107 | return frame; | 112 | return frame; |
108 | }; | 113 | }; |
109 | int Lib::error() { | 114 | int Lib::error() { |
110 | return xine_get_error( m_xine ); | 115 | return xine_get_error( m_xine ); |
111 | }; | 116 | }; |
112 | 117 | ||