summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer3/audiowidget.cpp
Unidiff
Diffstat (limited to 'noncore/multimedia/opieplayer3/audiowidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer3/audiowidget.cpp33
1 files changed, 27 insertions, 6 deletions
diff --git a/noncore/multimedia/opieplayer3/audiowidget.cpp b/noncore/multimedia/opieplayer3/audiowidget.cpp
index 7ba6274..b435c1b 100644
--- a/noncore/multimedia/opieplayer3/audiowidget.cpp
+++ b/noncore/multimedia/opieplayer3/audiowidget.cpp
@@ -17,6 +17,7 @@ AudioWidget::AudioWidget( QWidget * parent, const char * name, WFlags f)
17 m_MainLayout = new QVBoxLayout(this); 17 m_MainLayout = new QVBoxLayout(this);
18 m_MainLayout->setAutoAdd(true); 18 m_MainLayout->setAutoAdd(true);
19 m_InfoBox = new QTextView(this); 19 m_InfoBox = new QTextView(this);
20#if 0
20 m_PosSlider = new QSlider(QSlider::Horizontal,this); 21 m_PosSlider = new QSlider(QSlider::Horizontal,this);
21 m_PosSlider->setTickInterval(60); 22 m_PosSlider->setTickInterval(60);
22 connect(m_PosSlider,SIGNAL(valueChanged(int)),this,SLOT(slotNewPos(int))); 23 connect(m_PosSlider,SIGNAL(valueChanged(int)),this,SLOT(slotNewPos(int)));
@@ -25,27 +26,34 @@ AudioWidget::AudioWidget( QWidget * parent, const char * name, WFlags f)
25 connect(m_PosSlider,SIGNAL(sliderReleased()),this,SLOT(sliderReleased())); 26 connect(m_PosSlider,SIGNAL(sliderReleased()),this,SLOT(sliderReleased()));
26 m_pressed = false; 27 m_pressed = false;
27 m_uppos=0; 28 m_uppos=0;
29#endif
28} 30}
29 31
30AudioWidget::~AudioWidget() 32AudioWidget::~AudioWidget()
31{ 33{
32} 34}
33 35
34void AudioWidget::slotNewPos(int pos) 36void AudioWidget::slotNewPos(int /* pos*/)
35{ 37{
36 if (!m_xineLib) return; 38 if (!m_xineLib) return;
39#if 0
37 if (m_uppos==pos) return; 40 if (m_uppos==pos) return;
38 m_xineLib->seekTo(pos); 41 m_xineLib->seekTo(pos);
42#endif
39} 43}
40 44
41void AudioWidget::sliderPressed() 45void AudioWidget::sliderPressed()
42{ 46{
47#if 0
43 m_pressed = true; 48 m_pressed = true;
49#endif
44} 50}
45 51
46void AudioWidget::sliderReleased() 52void AudioWidget::sliderReleased()
47{ 53{
54#if 0
48 m_pressed = false; 55 m_pressed = false;
56#endif
49} 57}
50 58
51void AudioWidget::closeEvent(QCloseEvent*e) 59void AudioWidget::closeEvent(QCloseEvent*e)
@@ -57,20 +65,25 @@ void AudioWidget::closeEvent(QCloseEvent*e)
57 QWidget::closeEvent(e); 65 QWidget::closeEvent(e);
58} 66}
59 67
60void AudioWidget::playFile(const DocLnk&aLnk,XINE::Lib*aLib) 68int AudioWidget::playFile(const DocLnk&aLnk,XINE::Lib*aLib)
61{ 69{
62 m_current = aLnk; 70 m_current = aLnk;
63 if (m_xineLib != aLib) { 71 if (m_xineLib != aLib) {
64 disconnect(m_xineLib); 72 if (m_xineLib) disconnect(m_xineLib);
65 m_xineLib = aLib; 73 m_xineLib = aLib;
66 } 74 }
67 if (!m_xineLib) { 75 if (!m_xineLib) {
68 return; 76 return -1;
69 } 77 }
78#if 0
70 m_uppos=0; 79 m_uppos=0;
71 m_PosSlider->setValue(0); 80 m_PosSlider->setValue(0);
81#endif
72 m_xineLib->setShowVideo(false); 82 m_xineLib->setShowVideo(false);
73 m_xineLib->play(m_current.file()); 83 int res = m_xineLib->play(m_current.file());
84 if (res != 1) {
85 return -2;
86 }
74 // title 87 // title
75 QString title = m_xineLib->metaInfo(0); 88 QString title = m_xineLib->metaInfo(0);
76 // artist 89 // artist
@@ -79,7 +92,10 @@ void AudioWidget::playFile(const DocLnk&aLnk,XINE::Lib*aLib)
79 QString album = m_xineLib->metaInfo(4); 92 QString album = m_xineLib->metaInfo(4);
80 93
81 int l = m_xineLib->length(); 94 int l = m_xineLib->length();
95 int tmp = l;
96#if 0
82 m_PosSlider->setRange(0,l); 97 m_PosSlider->setRange(0,l);
98#endif
83 QString laenge=""; 99 QString laenge="";
84 int h = l/3600; 100 int h = l/3600;
85 l-=h*3600; 101 l-=h*3600;
@@ -102,12 +118,15 @@ void AudioWidget::playFile(const DocLnk&aLnk,XINE::Lib*aLib)
102 } 118 }
103 if (title.length()) { 119 if (title.length()) {
104 text+="<H2><center>"+title+"</center></h2>"; 120 text+="<H2><center>"+title+"</center></h2>";
121 } else {
122 text+="<H2><center>"+m_current.name()+"</center></h2>";
105 } 123 }
106 if (album.length()) { 124 if (album.length()) {
107 text+="<H2><center>"+album+"</center></h2>"; 125 text+="<H2><center>"+album+"</center></h2>";
108 } 126 }
109 text+="<h3><center>"+laenge+"</center></h3>"; 127 text+="<h3><center>"+laenge+"</center></h3>";
110 m_InfoBox->setText(text); 128 m_InfoBox->setText(text);
129 return tmp;
111} 130}
112 131
113void AudioWidget::stopPlaying() 132void AudioWidget::stopPlaying()
@@ -117,9 +136,11 @@ void AudioWidget::stopPlaying()
117 } 136 }
118} 137}
119 138
120void AudioWidget::updatePos(int val) 139void AudioWidget::updatePos(int /* val */)
121{ 140{
141#if 0
122 if (m_pressed) return; 142 if (m_pressed) return;
123 m_uppos = val; 143 m_uppos = val;
124 m_PosSlider->setValue(val); 144 m_PosSlider->setValue(val);
145#endif
125} 146}