Skip to content

Commit 5134ea5

Browse files
Merge branch 'master' into rtp
2 parents fc54265 + 9c4e7fd commit 5134ea5

File tree

77 files changed

+6373
-498
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+6373
-498
lines changed

mythplugins/mytharchive/theme/default-wide/mythburn-ui.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ MythArchive GUI theme
1010
<window name="profilepopup">
1111
<area>-1,-1,413,426</area>
1212

13-
<shape name="background" from="basebackground">
13+
<imagetype name="backimg">
1414
<area>0,0,413,426</area>
15-
<fill color="#000000" alpha="220" />
16-
</shape>
15+
<filename>mythdialogbox-background.png</filename>
16+
</imagetype>
1717

1818
<textarea name="title" from="basetextarea">
1919
<area>20,20,360,40</area>

mythplugins/mytharchive/theme/default/mythburn-ui.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ MythArchive GUI theme
1010
<window name="profilepopup">
1111
<area>-1,-1,413,426</area>
1212

13-
<shape name="background" from="basebackground">
13+
<imagetype name="backimg">
1414
<area>0,0,413,426</area>
15-
<fill color="#000000" alpha="220" />
16-
</shape>
15+
<filename>mythdialogbox-background.png</filename>
16+
</imagetype>
1717

1818
<textarea name="title" from="basetextarea">
1919
<area>20,20,360,40</area>

mythplugins/mythmusic/mythmusic/musiccommon.cpp

Lines changed: 39 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -223,27 +223,21 @@ bool MusicCommon::CreateCommon(void)
223223
if (m_movingTracksState)
224224
m_movingTracksState->DisplayState("off");
225225

226+
if (m_stopButton)
227+
m_stopButton->SetLocked(gPlayer->isStopped());
228+
if (m_playButton)
229+
m_playButton->SetLocked(gPlayer->isPlaying());
230+
if (m_pauseButton)
231+
m_pauseButton->SetLocked(gPlayer->isPaused());
226232
if (m_trackState)
227233
{
228-
if (!gPlayer->isPlaying()) // TODO: Add Player status check
229-
{
230-
if (gPlayer->getOutput() && gPlayer->getOutput()->IsPaused())
231-
m_trackState->DisplayState("paused");
232-
else
233-
m_trackState->DisplayState("stopped");
234-
}
235-
else
234+
if (gPlayer->isPlaying())
236235
m_trackState->DisplayState("playing");
237-
}
236+
else if (gPlayer->isPaused())
237+
m_trackState->DisplayState("paused");
238+
else
239+
m_trackState->DisplayState("stopped");
238240

239-
if (gPlayer->isPlaying())
240-
{
241-
if (m_stopButton)
242-
m_stopButton->SetLocked(false);
243-
if (m_playButton)
244-
m_playButton->SetLocked(true);
245-
if (m_pauseButton)
246-
m_pauseButton->SetLocked(false);
247241
}
248242

249243
updateShuffleMode();
@@ -346,22 +340,10 @@ void MusicCommon::switchView(MusicView view)
346340
}
347341

348342
gPlayer->removeListener(this);
343+
gPlayer->setAllowRestorePos(false);
349344

350345
switch (view)
351346
{
352-
#if 0
353-
case MV_LYRICS:
354-
{
355-
LyricsView *view = new LyricsView(mainStack);
356-
357-
if (view->Create())
358-
mainStack->AddScreen(view);
359-
else
360-
delete view;
361-
362-
break;
363-
}
364-
#endif
365347
case MV_PLAYLIST:
366348
{
367349
PlaylistView *view = new PlaylistView(mainStack);
@@ -378,7 +360,7 @@ void MusicCommon::switchView(MusicView view)
378360
{
379361
// if we are switching playlist editor views save and restore
380362
// the current position in the tree
381-
bool restorePos = (m_currentView == MV_PLAYLISTEDITORGALLERY);
363+
bool restorePos = (m_currentView == MV_PLAYLISTEDITORGALLERY);
382364
PlaylistEditorView *oldView = dynamic_cast<PlaylistEditorView *>(this);
383365
if (oldView)
384366
oldView->saveTreePosition();
@@ -397,7 +379,7 @@ void MusicCommon::switchView(MusicView view)
397379
{
398380
// if we are switching playlist editor views save and restore
399381
// the current position in the tree
400-
bool restorePos = (m_currentView == MV_PLAYLISTEDITORTREE);
382+
bool restorePos = (m_currentView == MV_PLAYLISTEDITORTREE);
401383
PlaylistEditorView *oldView = dynamic_cast<PlaylistEditorView *>(this);
402384
if (oldView)
403385
oldView->saveTreePosition();
@@ -441,6 +423,8 @@ void MusicCommon::switchView(MusicView view)
441423
}
442424

443425
Close();
426+
427+
gPlayer->setAllowRestorePos(true);
444428
}
445429

446430
#if 0
@@ -1526,7 +1510,8 @@ void MusicCommon::customEvent(QEvent *event)
15261510

15271511
item->SetTextFromMap(metadataMap);
15281512

1529-
if (gPlayer->isPlaying() && mdata->ID() == gPlayer->getCurrentMetadata()->ID())
1513+
if (gPlayer->isPlaying() && gPlayer->getCurrentMetadata() &&
1514+
mdata->ID() == gPlayer->getCurrentMetadata()->ID())
15301515
{
15311516
item->SetFontState("running");
15321517
item->DisplayState("playing", "playstate");
@@ -1622,7 +1607,7 @@ void MusicCommon::customEvent(QEvent *event)
16221607
}
16231608
}
16241609

1625-
if (trackID == gPlayer->getCurrentMetadata()->ID())
1610+
if (gPlayer->getCurrentMetadata() && trackID == gPlayer->getCurrentMetadata()->ID())
16261611
updateTrackInfo(gPlayer->getCurrentMetadata());
16271612
}
16281613
}
@@ -1822,21 +1807,32 @@ void MusicCommon::updateUIPlaylist(void)
18221807
MetadataMap metadataMap;
18231808
mdata->toMap(metadataMap);
18241809
item->SetTextFromMap(metadataMap);
1810+
item->SetFontState("normal");
1811+
item->DisplayState("default", "playstate");
18251812

1826-
if (gPlayer->isPlaying() && mdata->ID() == gPlayer->getCurrentMetadata()->ID())
1827-
{
1828-
item->SetFontState("running");
1829-
item->DisplayState("playing", "playstate");
1830-
}
1831-
else
1813+
// if this is the current track update its play state to match the player
1814+
if (gPlayer->getCurrentMetadata() && mdata->ID() == gPlayer->getCurrentMetadata()->ID())
18321815
{
1833-
item->SetFontState("normal");
1834-
item->DisplayState("default", "playstate");
1816+
if (gPlayer->isPlaying())
1817+
{
1818+
item->SetFontState("running");
1819+
item->DisplayState("playing", "playstate");
1820+
}
1821+
else if (gPlayer->isPaused())
1822+
{
1823+
item->SetFontState("idle");
1824+
item->DisplayState("paused", "playstate");
1825+
}
1826+
else
1827+
{
1828+
item->SetFontState("normal");
1829+
item->DisplayState("stopped", "playstate");
1830+
}
18351831
}
18361832

18371833
item->DisplayState(QString("%1").arg(mdata->Rating()), "ratingstate");
18381834

1839-
if (mdata->ID() == gPlayer->getCurrentMetadata()->ID())
1835+
if (gPlayer->getCurrentMetadata() && mdata->ID() == gPlayer->getCurrentMetadata()->ID())
18401836
m_currentPlaylist->SetItemCurrent(item);
18411837
}
18421838
}

mythplugins/mythmusic/mythmusic/musicplayer.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ MusicPlayer::MusicPlayer(QObject *parent, const QString &dev)
6868
m_canShowPlayer = true;
6969
m_wasPlaying = true;
7070
m_updatedLastplay = false;
71+
m_allowRestorePos = true;
7172

7273
m_playSpeed = 1.0;
7374

@@ -883,6 +884,10 @@ void MusicPlayer::savePosition(void)
883884

884885
void MusicPlayer::restorePosition(void)
885886
{
887+
// if we are switching views we don't wont to restore the position
888+
if (!m_allowRestorePos)
889+
return;
890+
886891
m_currentTrack = 0;
887892
uint trackID = 0;
888893

@@ -946,12 +951,12 @@ void MusicPlayer::changeCurrentTrack(int trackNo)
946951
m_currentTrack = trackNo;
947952

948953
// sanity check the current track
949-
if (m_currentTrack < 0 || m_currentTrack > m_currentPlaylist->getSongs().size())
954+
if (m_currentTrack < 0 || m_currentTrack >= m_currentPlaylist->getSongs().size())
950955
{
951956
LOG(VB_GENERAL, LOG_ERR,
952957
QString("MusicPlayer: asked to set the current track to an invalid track no. %1")
953958
.arg(trackNo));
954-
m_currentTrack = 0;
959+
m_currentTrack = -1;
955960
m_currentMetadata = NULL;
956961
return;
957962
}
@@ -1225,6 +1230,8 @@ void MusicPlayer::activePlaylistChanged(int trackID, bool deleted)
12251230
if (deleted)
12261231
{
12271232
// all tracks were removed
1233+
m_currentTrack = -1;
1234+
m_currentMetadata = NULL;
12281235
stop(true);
12291236
MusicPlayerEvent me(MusicPlayerEvent::AllTracksRemovedEvent, 0);
12301237
dispatch(me);

mythplugins/mythmusic/mythmusic/musicplayer.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ class MusicPlayer : public QObject, public MythObservable
8888
void nextAuto(void);
8989

9090
bool isPlaying(void) { return m_isPlaying; }
91+
bool isPaused(void) { return getOutput() ? getOutput()->IsPaused() : false; }
92+
bool isStopped(void) { return !(isPlaying() || isPaused()); }
9193
bool hasClient(void) { return hasListeners(); }
9294

9395
/// This will allow/disallow the mini player showing on track changes
@@ -122,6 +124,7 @@ class MusicPlayer : public QObject, public MythObservable
122124

123125
void savePosition(void);
124126
void restorePosition(void);
127+
void setAllowRestorePos(bool allow) { m_allowRestorePos = allow; }
125128
void seek(int pos);
126129

127130
Metadata *getCurrentMetadata(void);
@@ -202,6 +205,7 @@ class MusicPlayer : public QObject, public MythObservable
202205
bool m_autoShowPlayer;
203206
bool m_wasPlaying;
204207
bool m_updatedLastplay;
208+
bool m_allowRestorePos;
205209

206210
int m_lastplayDelay;
207211

mythplugins/mythmusic/mythmusic/playlisteditorview.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,7 @@ void PlaylistEditorView::customEvent(QEvent *event)
204204
}
205205
else if (event->type() == DialogCompletionEvent::kEventType)
206206
{
207-
DialogCompletionEvent *dce = dynamic_cast<DialogCompletionEvent*>(event);
208-
209-
if (!dce)
210-
return;
207+
DialogCompletionEvent *dce = static_cast<DialogCompletionEvent*>(event);
211208

212209
// make sure the user didn't ESCAPE out of the menu
213210
if (dce->GetResult() < 0)

mythplugins/mythmusic/mythmusic/searchview.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,7 @@ void SearchView::customEvent(QEvent *event)
160160
}
161161
else if (event->type() == DialogCompletionEvent::kEventType)
162162
{
163-
DialogCompletionEvent *dce = dynamic_cast<DialogCompletionEvent *>(event);
164-
165-
if (!dce)
166-
return;
163+
DialogCompletionEvent *dce = static_cast<DialogCompletionEvent *>(event);
167164

168165
// make sure the user didn't ESCAPE out of the menu
169166
if (dce->GetResult() < 0)

mythplugins/mythzoneminder/theme/default-wide/zoneminder-ui.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
<window name="functionpopup">
66
<area>-1,-1,413,426</area>
77

8-
<imagetype name="box">
9-
<filename>mz_function_popup.png</filename>
8+
<imagetype name="backimg">
9+
<area>0,0,413,426</area>
10+
<filename>mythdialogbox-background.png</filename>
1011
</imagetype>
1112

1213
<textarea name="title" from="basetextarea">
Binary file not shown.

mythplugins/mythzoneminder/theme/default/zoneminder-ui.xml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99
<weight>bold</weight>
1010
</fontdef>
1111

12-
<area>193,87,413,426</area>
12+
<area>-1,-1,413,426</area>
1313

14-
<imagetype name="box">
15-
<filename>mz_function_popup.png</filename>
14+
<imagetype name="backimg">
15+
<area>0,0,413,426</area>
16+
<filename>mythdialogbox-background.png</filename>
1617
</imagetype>
1718

1819
<textarea name="title" from="basetextarea">

0 commit comments

Comments
 (0)