Diffstat (limited to 'noncore/multimedia/opieplayer3/mwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer3/mwindow.cpp | 81 |
1 files changed, 63 insertions, 18 deletions
diff --git a/noncore/multimedia/opieplayer3/mwindow.cpp b/noncore/multimedia/opieplayer3/mwindow.cpp index 57418f0..75d1490 100644 --- a/noncore/multimedia/opieplayer3/mwindow.cpp +++ b/noncore/multimedia/opieplayer3/mwindow.cpp | |||
@@ -51,83 +51,92 @@ | |||
51 | #include <qmenubar.h> | 51 | #include <qmenubar.h> |
52 | #include <qtimer.h> | 52 | #include <qtimer.h> |
53 | #include <qslider.h> | 53 | #include <qslider.h> |
54 | #include <qlayout.h> | 54 | #include <qlayout.h> |
55 | 55 | ||
56 | OPIE_EXPORT_APP( Opie::Core::OApplicationFactory<PMainWindow>) | 56 | OPIE_EXPORT_APP( Opie::Core::OApplicationFactory<PMainWindow>) |
57 | 57 | ||
58 | using namespace Opie::Ui; | 58 | using namespace Opie::Ui; |
59 | 59 | ||
60 | PMainWindow::PMainWindow(QWidget*w, const char*name, WFlags f) | 60 | PMainWindow::PMainWindow(QWidget*w, const char*name, WFlags f) |
61 | : QMainWindow(w,name,f) | 61 | : QMainWindow(w,name,f) |
62 | { | 62 | { |
63 | checkLib(); | ||
63 | setCaption( QObject::tr("Opie Mediaplayer 3" ) ); | 64 | setCaption( QObject::tr("Opie Mediaplayer 3" ) ); |
64 | 65 | ||
65 | m_MainBox = new QWidget(this); | 66 | m_MainBox = new QWidget(this); |
66 | 67 | ||
67 | QVBoxLayout*m_l = new QVBoxLayout(m_MainBox); | 68 | QVBoxLayout*m_l = new QVBoxLayout(m_MainBox); |
68 | 69 | ||
69 | m_stack = new OWidgetStack(m_MainBox); | 70 | m_stack = new OWidgetStack(m_MainBox); |
70 | m_stack->forceMode(Opie::Ui::OWidgetStack::SmallScreen); | 71 | m_stack->forceMode(Opie::Ui::OWidgetStack::SmallScreen); |
71 | m_l->addWidget(m_stack); | 72 | m_l->addWidget(m_stack); |
72 | m_scrollBar = new QSlider(QSlider::Horizontal,m_MainBox); | 73 | m_PosSlider = new QSlider(QSlider::Horizontal,m_MainBox); |
73 | m_l->addWidget(m_scrollBar); | 74 | m_l->addWidget(m_PosSlider); |
74 | m_scrollBar->setEnabled(false); | 75 | m_PosSlider->setEnabled(false); |
75 | 76 | ||
76 | m_playList = new PlaylistView(m_stack,"playlist"); | 77 | m_playList = new PlaylistView(m_stack,"playlist"); |
77 | m_stack->addWidget(m_playList,stack_list); | 78 | m_stack->addWidget(m_playList,stack_list); |
78 | connect(m_playList,SIGNAL(contentChanged(int)),this,SLOT(slotListChanged(int))); | 79 | connect(m_playList,SIGNAL(contentChanged(int)),this,SLOT(slotListChanged(int))); |
79 | m_sfl = new OFileSelector("video/*;audio/*",m_stack); | 80 | m_sfl = new OFileSelector("video/*;audio/*",m_stack); |
80 | m_stack->addWidget(m_sfl,stack_file); | 81 | m_stack->addWidget(m_sfl,stack_file); |
81 | connect(m_sfl, SIGNAL(fileSelected(const DocLnk &)), m_playList, SLOT(slotAddFile(const DocLnk &))); | 82 | connect(m_sfl, SIGNAL(fileSelected(const DocLnk &)), m_playList, SLOT(slotAddFile(const DocLnk &))); |
82 | m_AudioPlayer = new AudioWidget(m_stack); | 83 | m_AudioPlayer = new AudioWidget(m_stack); |
83 | m_stack->addWidget(m_AudioPlayer,stack_audio); | 84 | m_stack->addWidget(m_AudioPlayer,stack_audio); |
84 | connect(this,SIGNAL(sigPos(int)),m_AudioPlayer,SLOT(updatePos(int))); | 85 | connect(this,SIGNAL(sigPos(int)),m_AudioPlayer,SLOT(updatePos(int))); |
85 | m_VideoPlayer = new VideoWidget(m_stack); | 86 | m_VideoPlayer = new VideoWidget(m_stack); |
86 | m_stack->addWidget(m_VideoPlayer,stack_video); | 87 | m_stack->addWidget(m_VideoPlayer,stack_video); |
87 | connect(this,SIGNAL(sigPos(int)),m_VideoPlayer,SLOT(updatePos(int))); | 88 | connect(this,SIGNAL(sigPos(int)),m_VideoPlayer,SLOT(updatePos(int))); |
88 | connect(m_VideoPlayer,SIGNAL(videoclicked()),this,SLOT(slotVideoclicked())); | 89 | connect(m_VideoPlayer,SIGNAL(videoclicked()),this,SLOT(slotVideoclicked())); |
89 | 90 | ||
91 | connect(m_PosSlider,SIGNAL(valueChanged(int)),this,SLOT(slotNewPos(int))); | ||
92 | connect(m_PosSlider,SIGNAL(sliderMoved(int)),this,SLOT(slotNewPos(int))); | ||
93 | connect(m_PosSlider,SIGNAL(sliderPressed()),this,SLOT(sliderPressed())); | ||
94 | connect(m_PosSlider,SIGNAL(sliderReleased()),this,SLOT(sliderReleased())); | ||
95 | m_pressed = false; | ||
96 | m_uppos=0; | ||
97 | |||
90 | m_stack->raiseWidget(stack_list); | 98 | m_stack->raiseWidget(stack_list); |
91 | m_PlayLib = 0; | ||
92 | m_LastItem = 0; | 99 | m_LastItem = 0; |
93 | setupActions(); | 100 | setupActions(); |
94 | setupToolBar(); | 101 | setupToolBar(); |
95 | setupMenu(); | 102 | setupMenu(); |
96 | 103 | ||
97 | setCentralWidget(m_MainBox ); | 104 | setCentralWidget(m_MainBox ); |
98 | } | 105 | } |
99 | 106 | ||
100 | void PMainWindow::slotListChanged(int count) | 107 | void PMainWindow::slotListChanged(int count) |
101 | { | 108 | { |
109 | playersGroup->setEnabled(count>0); | ||
102 | if (!m_playList->isVisible()) { | 110 | if (!m_playList->isVisible()) { |
103 | return; | 111 | return; |
104 | } | 112 | } |
105 | a_removeFiles->setEnabled(count>0); | 113 | a_removeFiles->setEnabled(count>0); |
106 | } | 114 | } |
107 | 115 | ||
108 | void PMainWindow::mediaWindowraised() | 116 | void PMainWindow::mediaWindowraised() |
109 | { | 117 | { |
110 | playlistOnly->setEnabled(false); | 118 | playlistOnly->setEnabled(false); |
111 | a_appendFiles->setEnabled(true); | 119 | a_appendFiles->setEnabled(true); |
112 | a_loadPlaylist->setEnabled(true); | 120 | a_loadPlaylist->setEnabled(true); |
113 | a_showPlaylist->setEnabled(true); | 121 | a_showPlaylist->setEnabled(true); |
114 | a_ShowMedia->setEnabled(false); | 122 | a_ShowMedia->setEnabled(false); |
115 | } | 123 | } |
116 | 124 | ||
117 | void PMainWindow::checkLib() | 125 | void PMainWindow::checkLib() |
118 | { | 126 | { |
119 | if (m_PlayLib == 0) { | 127 | if (m_PlayLib == 0) { |
120 | m_PlayLib = new XINE::Lib(XINE::Lib::InitializeImmediately); | 128 | m_PlayLib = new XINE::Lib(XINE::Lib::InitializeInThread); |
121 | m_PlayLib->ensureInitialized(); | 129 | qApp->processEvents(); |
130 | // m_PlayLib->ensureInitialized(); | ||
122 | connect(m_PlayLib,SIGNAL(stopped()),this,SLOT(slotStopped())); | 131 | connect(m_PlayLib,SIGNAL(stopped()),this,SLOT(slotStopped())); |
123 | } | 132 | } |
124 | } | 133 | } |
125 | 134 | ||
126 | PMainWindow::~PMainWindow() | 135 | PMainWindow::~PMainWindow() |
127 | { | 136 | { |
128 | if (m_PlayLib) { | 137 | if (m_PlayLib) { |
129 | m_PlayLib->stop(); | 138 | m_PlayLib->stop(); |
130 | delete m_PlayLib; | 139 | delete m_PlayLib; |
131 | } | 140 | } |
132 | } | 141 | } |
133 | 142 | ||
@@ -190,25 +199,25 @@ void PMainWindow::slotPlayList() | |||
190 | slotPlayNext(); | 199 | slotPlayNext(); |
191 | return; | 200 | return; |
192 | } | 201 | } |
193 | //m_VideoPlayer->setFullScreen(a_ShowFull->isOn()); | 202 | //m_VideoPlayer->setFullScreen(a_ShowFull->isOn()); |
194 | slotPlayCurrent(); | 203 | slotPlayCurrent(); |
195 | } | 204 | } |
196 | 205 | ||
197 | void PMainWindow::slotUserStop() | 206 | void PMainWindow::slotUserStop() |
198 | { | 207 | { |
199 | if (!m_playing || !m_PlayLib) return; | 208 | if (!m_playing || !m_PlayLib) return; |
200 | m_playing = false; | 209 | m_playing = false; |
201 | m_PlayLib->stop(); | 210 | m_PlayLib->stop(); |
202 | m_scrollBar->setEnabled(false); | 211 | m_PosSlider->setEnabled(false); |
203 | hideVideo(); | 212 | hideVideo(); |
204 | slotShowList(); | 213 | slotShowList(); |
205 | } | 214 | } |
206 | 215 | ||
207 | void PMainWindow::slotTogglePlay(bool how) | 216 | void PMainWindow::slotTogglePlay(bool how) |
208 | { | 217 | { |
209 | if (how == m_playing) { | 218 | if (how == m_playing) { |
210 | if (how) { | 219 | if (how) { |
211 | slotShowMediaWindow(); | 220 | slotShowMediaWindow(); |
212 | } | 221 | } |
213 | return; | 222 | return; |
214 | } | 223 | } |
@@ -222,54 +231,54 @@ void PMainWindow::slotTogglePlay(bool how) | |||
222 | void PMainWindow::hideVideo() | 231 | void PMainWindow::hideVideo() |
223 | { | 232 | { |
224 | if (m_VideoPlayer->isVisible() && a_ShowFull->isOn()) { | 233 | if (m_VideoPlayer->isVisible() && a_ShowFull->isOn()) { |
225 | //m_VideoPlayer->showNormal(); | 234 | //m_VideoPlayer->showNormal(); |
226 | m_VideoPlayer->hide(); | 235 | m_VideoPlayer->hide(); |
227 | } | 236 | } |
228 | } | 237 | } |
229 | 238 | ||
230 | void PMainWindow::slotPlayCurrent() | 239 | void PMainWindow::slotPlayCurrent() |
231 | { | 240 | { |
232 | if (!m_LastItem) { | 241 | if (!m_LastItem) { |
233 | if (m_PlayLib) m_PlayLib->stop(); | 242 | if (m_PlayLib) m_PlayLib->stop(); |
234 | m_scrollBar->setEnabled(false); | 243 | m_PosSlider->setEnabled(false); |
235 | a_playAction->setOn(false); | 244 | a_playAction->setOn(false); |
236 | hideVideo(); | 245 | hideVideo(); |
237 | slotShowList(); | 246 | slotShowList(); |
238 | return; | 247 | return; |
239 | } | 248 | } |
240 | checkLib(); | ||
241 | m_CurrentPos = 0; | 249 | m_CurrentPos = 0; |
242 | m_playList->setCurrentItem(m_LastItem); | 250 | m_playList->setCurrentItem(m_LastItem); |
243 | odebug << "Pos: " << m_PlayLib->currentTime() << oendl; | 251 | m_uppos = 0; |
252 | m_PosSlider->setValue(0); | ||
244 | int result = 0; | 253 | int result = 0; |
245 | if (!m_LastItem->isVideo()) { | 254 | if (!m_LastItem->isVideo()) { |
246 | hideVideo(); | 255 | hideVideo(); |
247 | m_playing = true; | 256 | m_playing = true; |
248 | m_stack->raiseWidget(stack_audio); | 257 | m_stack->raiseWidget(stack_audio); |
249 | result = m_AudioPlayer->playFile(m_LastItem->Lnk(),m_PlayLib); | 258 | result = m_AudioPlayer->playFile(m_LastItem->Lnk(),m_PlayLib); |
250 | } else { | 259 | } else { |
251 | m_playing = true; | 260 | m_playing = true; |
252 | setupVideo(a_ShowFull->isOn()); | 261 | setupVideo(a_ShowFull->isOn()); |
253 | result = m_VideoPlayer->playFile(m_LastItem->Lnk(),m_PlayLib); | 262 | result = m_VideoPlayer->playFile(m_LastItem->Lnk(),m_PlayLib); |
254 | } | 263 | } |
255 | if (result<0) { | 264 | if (result<0) { |
256 | // fehler | 265 | // fehler |
257 | return; | 266 | return; |
258 | } | 267 | } |
259 | mediaWindowraised(); | 268 | mediaWindowraised(); |
260 | odebug << "Range: " << result << oendl; | 269 | odebug << "Range: " << result << oendl; |
261 | m_scrollBar->setRange(0,result); | 270 | m_PosSlider->setEnabled(true); |
262 | m_scrollBar->setValue(0); | 271 | m_PosSlider->setRange(0,m_PlayLib->length()); |
263 | m_scrollBar->setEnabled(true); | 272 | m_PosSlider->setValue(m_PlayLib->currentTime()); |
264 | QTimer::singleShot( 500, this, SLOT( slotCheckPos() ) ); | 273 | QTimer::singleShot( 500, this, SLOT( slotCheckPos() ) ); |
265 | } | 274 | } |
266 | 275 | ||
267 | void PMainWindow::slotPlayNext() | 276 | void PMainWindow::slotPlayNext() |
268 | { | 277 | { |
269 | PlaylistItem*item = m_playList->nextItem(m_LastItem); | 278 | PlaylistItem*item = m_playList->nextItem(m_LastItem); |
270 | if (!item) return; | 279 | if (!item) return; |
271 | m_LastItem = item; | 280 | m_LastItem = item; |
272 | slotPlayCurrent(); | 281 | slotPlayCurrent(); |
273 | } | 282 | } |
274 | 283 | ||
275 | void PMainWindow::slotGoNext() | 284 | void PMainWindow::slotGoNext() |
@@ -280,53 +289,57 @@ void PMainWindow::slotGoNext() | |||
280 | 289 | ||
281 | void PMainWindow::slotPlayPrevious() | 290 | void PMainWindow::slotPlayPrevious() |
282 | { | 291 | { |
283 | PlaylistItem*item = m_playList->prevItem(m_LastItem); | 292 | PlaylistItem*item = m_playList->prevItem(m_LastItem); |
284 | if (!item) return; | 293 | if (!item) return; |
285 | m_LastItem = item; | 294 | m_LastItem = item; |
286 | slotPlayCurrent(); | 295 | slotPlayCurrent(); |
287 | } | 296 | } |
288 | 297 | ||
289 | void PMainWindow::slotStopped() | 298 | void PMainWindow::slotStopped() |
290 | { | 299 | { |
291 | if (!m_playing) return; | 300 | if (!m_playing) return; |
301 | odebug << "Slot stopped" << oendl; | ||
292 | m_playing = false; | 302 | m_playing = false; |
293 | slotGoNext(); | 303 | slotGoNext(); |
294 | } | 304 | } |
295 | 305 | ||
296 | void PMainWindow::slotCheckPos() | 306 | void PMainWindow::slotCheckPos() |
297 | { | 307 | { |
298 | if (!m_playing) return; | 308 | if (!m_playing) return; |
299 | //emit sigPos(m_PlayLib->currentTime()); | 309 | if (!m_pressed) { |
300 | m_scrollBar->setValue(m_PlayLib->currentTime()); | 310 | m_uppos = m_PlayLib->currentTime(); |
311 | emit sigPos(m_uppos); | ||
312 | m_PosSlider->setValue(m_PlayLib->currentTime()); | ||
313 | } | ||
301 | QTimer::singleShot( 1000, this, SLOT( slotCheckPos() ) ); | 314 | QTimer::singleShot( 1000, this, SLOT( slotCheckPos() ) ); |
302 | } | 315 | } |
303 | 316 | ||
304 | void PMainWindow::slotRemoveFiles() | 317 | void PMainWindow::slotRemoveFiles() |
305 | { | 318 | { |
306 | if (m_playing||!m_playList->isVisible()) return; | 319 | if (m_playing||!m_playList->isVisible()) return; |
307 | PlaylistItem* Item = m_playList->currentItem(); | 320 | PlaylistItem* Item = m_playList->currentItem(); |
308 | slotShowList(); | 321 | slotShowList(); |
309 | m_playList->removeFromList(Item); | 322 | m_playList->removeFromList(Item); |
310 | } | 323 | } |
311 | 324 | ||
312 | void PMainWindow::setupActions() | 325 | void PMainWindow::setupActions() |
313 | { | 326 | { |
314 | a_appendFiles = new QAction(tr("Append file(s)"),Resource::loadIconSet( "opieplayer2/add_to_playlist" ), 0, 0, this, 0, false ); | 327 | a_appendFiles = new QAction(tr("Append file(s)"),Resource::loadIconSet( "opieplayer2/add_to_playlist" ), 0, 0, this, 0, false ); |
315 | connect(a_appendFiles,SIGNAL(activated()),this,SLOT(slotAppendFiles())); | 328 | connect(a_appendFiles,SIGNAL(activated()),this,SLOT(slotAppendFiles())); |
316 | a_addDir = new QAction(tr("Add directory"),Resource::loadIconSet("folder_open"),0,0,this,0,false); | 329 | a_addDir = new QAction(tr("Add directory"),Resource::loadIconSet("folder_open"),0,0,this,0,false); |
317 | connect(a_addDir,SIGNAL(activated()),m_playList,SLOT(slotAppendDir())); | 330 | connect(a_addDir,SIGNAL(activated()),m_playList,SLOT(slotAppendDir())); |
318 | a_loadPlaylist = new QAction(tr("Append .m3u playlist"),Resource::loadIconSet("opieplayer2/add_to_playlist"),0,0,this,0,false); | 331 | a_loadPlaylist = new QAction(tr("Append playlist"),Resource::loadIconSet("opieplayer2/add_to_playlist"),0,0,this,0,false); |
319 | connect(a_loadPlaylist,SIGNAL(activated()),m_playList,SLOT(slotOpenM3u())); | 332 | connect(a_loadPlaylist,SIGNAL(activated()),m_playList,SLOT(slotOpenM3u())); |
320 | a_savePlaylist = new QAction(tr("Save .m3u playlist"),Resource::loadIconSet("save"),0,0,this,0,false); | 333 | a_savePlaylist = new QAction(tr("Save playlist"),Resource::loadIconSet("save"),0,0,this,0,false); |
321 | connect(a_savePlaylist,SIGNAL(activated()),m_playList,SLOT(slotSaveAsM3u())); | 334 | connect(a_savePlaylist,SIGNAL(activated()),m_playList,SLOT(slotSaveAsM3u())); |
322 | 335 | ||
323 | playlistOnly = new QActionGroup(this,"playlistgroup",false); | 336 | playlistOnly = new QActionGroup(this,"playlistgroup",false); |
324 | playlistOnly->insert(a_appendFiles); | 337 | playlistOnly->insert(a_appendFiles); |
325 | playlistOnly->insert(a_addDir); | 338 | playlistOnly->insert(a_addDir); |
326 | playlistOnly->insert(a_loadPlaylist); | 339 | playlistOnly->insert(a_loadPlaylist); |
327 | playlistOnly->insert(a_savePlaylist); | 340 | playlistOnly->insert(a_savePlaylist); |
328 | 341 | ||
329 | a_showPlaylist = new QAction(tr("Show playlist"),Resource::loadIconSet( "txt" ), 0, 0, this, 0, false ); | 342 | a_showPlaylist = new QAction(tr("Show playlist"),Resource::loadIconSet( "txt" ), 0, 0, this, 0, false ); |
330 | connect(a_showPlaylist,SIGNAL(activated()),this,SLOT(slotShowList())); | 343 | connect(a_showPlaylist,SIGNAL(activated()),this,SLOT(slotShowList())); |
331 | a_ShowMedia = new QAction(tr("Show media window"),Resource::loadIconSet("opieplayer2/musicfile"), 0, 0, this, 0, false ); | 344 | a_ShowMedia = new QAction(tr("Show media window"),Resource::loadIconSet("opieplayer2/musicfile"), 0, 0, this, 0, false ); |
332 | connect(a_ShowMedia,SIGNAL(activated()),this,SLOT(slotShowMediaWindow())); | 345 | connect(a_ShowMedia,SIGNAL(activated()),this,SLOT(slotShowMediaWindow())); |
@@ -342,28 +355,36 @@ void PMainWindow::setupActions() | |||
342 | 355 | ||
343 | a_playNext = new QAction(tr("Play next in list"),Resource::loadIconSet( "fastforward" ), 0, 0, this, 0, false ); | 356 | a_playNext = new QAction(tr("Play next in list"),Resource::loadIconSet( "fastforward" ), 0, 0, this, 0, false ); |
344 | connect(a_playNext,SIGNAL(activated()),this,SLOT(slotPlayNext())); | 357 | connect(a_playNext,SIGNAL(activated()),this,SLOT(slotPlayNext())); |
345 | a_playPrevious = new QAction(tr("Play previous in list"),Resource::loadIconSet( "fastback" ), 0, 0, this, 0, false ); | 358 | a_playPrevious = new QAction(tr("Play previous in list"),Resource::loadIconSet( "fastback" ), 0, 0, this, 0, false ); |
346 | connect(a_playPrevious,SIGNAL(activated()),this,SLOT(slotPlayPrevious())); | 359 | connect(a_playPrevious,SIGNAL(activated()),this,SLOT(slotPlayPrevious())); |
347 | a_ShowFull = new QAction(tr("Show videos fullscreen"),Resource::loadIconSet( "fullscreen" ), 0, 0, this, 0, true ); | 360 | a_ShowFull = new QAction(tr("Show videos fullscreen"),Resource::loadIconSet( "fullscreen" ), 0, 0, this, 0, true ); |
348 | connect(a_ShowFull,SIGNAL(toggled(bool)),this,SLOT(slotToggleFull(bool))); | 361 | connect(a_ShowFull,SIGNAL(toggled(bool)),this,SLOT(slotToggleFull(bool))); |
349 | 362 | ||
350 | playersGroup->insert(a_playPrevious); | 363 | playersGroup->insert(a_playPrevious); |
351 | playersGroup->insert(a_playAction); | 364 | playersGroup->insert(a_playAction); |
352 | playersGroup->insert(a_playNext); | 365 | playersGroup->insert(a_playNext); |
353 | 366 | ||
367 | |||
354 | /* initial states of actions */ | 368 | /* initial states of actions */ |
355 | a_showPlaylist->setEnabled(false); | 369 | a_showPlaylist->setEnabled(false); |
356 | a_removeFiles->setEnabled(false); | 370 | a_removeFiles->setEnabled(false); |
357 | a_ShowMedia->setEnabled(false); | 371 | a_ShowMedia->setEnabled(false); |
372 | playersGroup->setEnabled(false); | ||
373 | |||
374 | settingsGroup = new QActionGroup(this,"configgroup",false); | ||
375 | |||
376 | a_Scaleup = new QAction(tr("Scale videos larger"),Resource::loadIconSet( "fullscreen" ), 0, 0, this, 0, true ); | ||
377 | connect(a_Scaleup,SIGNAL(toggled(bool)),this,SLOT(slot_scaleupToggled(bool))); | ||
378 | settingsGroup->insert(a_Scaleup); | ||
358 | } | 379 | } |
359 | 380 | ||
360 | void PMainWindow::setupToolBar() | 381 | void PMainWindow::setupToolBar() |
361 | { | 382 | { |
362 | setToolBarsMovable( false ); | 383 | setToolBarsMovable( false ); |
363 | m_toolBar = new QToolBar( this ); | 384 | m_toolBar = new QToolBar( this ); |
364 | //m_menuBar = new QMenuBar(m_toolBar); | 385 | //m_menuBar = new QMenuBar(m_toolBar); |
365 | m_menuBar=menuBar(); | 386 | m_menuBar=menuBar(); |
366 | addToolBar(m_toolBar); | 387 | addToolBar(m_toolBar); |
367 | m_toolBar->setHorizontalStretchable( true ); | 388 | m_toolBar->setHorizontalStretchable( true ); |
368 | a_appendFiles->addTo(m_toolBar); | 389 | a_appendFiles->addTo(m_toolBar); |
369 | a_removeFiles->addTo(m_toolBar); | 390 | a_removeFiles->addTo(m_toolBar); |
@@ -418,15 +439,39 @@ void PMainWindow::setupMenu() | |||
418 | a_addDir->addTo(fileMenu); | 439 | a_addDir->addTo(fileMenu); |
419 | fileMenu->insertSeparator(); | 440 | fileMenu->insertSeparator(); |
420 | a_loadPlaylist->addTo(fileMenu); | 441 | a_loadPlaylist->addTo(fileMenu); |
421 | a_savePlaylist->addTo(fileMenu); | 442 | a_savePlaylist->addTo(fileMenu); |
422 | 443 | ||
423 | dispMenu = new QPopupMenu( m_menuBar ); | 444 | dispMenu = new QPopupMenu( m_menuBar ); |
424 | m_menuBar->insertItem( tr( "Show" ), dispMenu ); | 445 | m_menuBar->insertItem( tr( "Show" ), dispMenu ); |
425 | a_showPlaylist->addTo(dispMenu); | 446 | a_showPlaylist->addTo(dispMenu); |
426 | a_ShowMedia->addTo(dispMenu); | 447 | a_ShowMedia->addTo(dispMenu); |
427 | a_ShowFull->addTo(dispMenu); | 448 | a_ShowFull->addTo(dispMenu); |
428 | playMenu = new QPopupMenu(m_menuBar); | 449 | playMenu = new QPopupMenu(m_menuBar); |
429 | m_menuBar->insertItem(tr("Playing"),playMenu); | 450 | m_menuBar->insertItem(tr("Playing"),playMenu); |
430 | |||
431 | playersGroup->addTo(playMenu); | 451 | playersGroup->addTo(playMenu); |
452 | configMenu = new QPopupMenu(m_menuBar); | ||
453 | m_menuBar->insertItem(tr("Config"),configMenu); | ||
454 | settingsGroup->addTo(configMenu); | ||
455 | } | ||
456 | |||
457 | void PMainWindow::slotNewPos(int pos) | ||
458 | { | ||
459 | if (!m_PlayLib) return; | ||
460 | if (m_uppos==pos) return; | ||
461 | m_PlayLib->seekTo(pos); | ||
462 | } | ||
463 | |||
464 | void PMainWindow::sliderPressed() | ||
465 | { | ||
466 | m_pressed = true; | ||
467 | } | ||
468 | |||
469 | void PMainWindow::sliderReleased() | ||
470 | { | ||
471 | m_pressed = false; | ||
472 | } | ||
473 | |||
474 | void PMainWindow::slot_scaleupToggled(bool how) | ||
475 | { | ||
476 | m_VideoPlayer->scaleUp(how); | ||
432 | } | 477 | } |