Changeset - r22837:96ab6aaff487
[Not reviewed]
master
0 1 0
Niels Martin Hansen - 6 years ago 2018-03-19 19:13:09
nielsm@indvikleren.dk
Codechange: Music GUI comments and function naming
1 file changed with 15 insertions and 9 deletions:
0 comments (0 inline, 0 general)
src/music_gui.cpp
Show inline comments
 
@@ -103,7 +103,7 @@ void ValidatePlaylist(byte *playlist, by
 
	*last = 0;
 
}
 

	
 
/** Initialize the playlists */
 
/** Prepare the playlists */
 
void InitializeMusic()
 
{
 
	uint j = 0;
 
@@ -195,7 +195,8 @@ static void DoStopMusic()
 
	SetWindowDirty(WC_MUSIC_WINDOW, 0);
 
}
 

	
 
static void SelectSongToPlay()
 
/** Reload the active playlist data from playlist selection and shuffle setting */
 
static void ResetPlaylist()
 
{
 
	uint i = 0;
 
	uint j = 0;
 
@@ -241,10 +242,11 @@ static void StopMusic()
 
	SetWindowWidgetDirty(WC_MUSIC_WINDOW, 0, 9);
 
}
 

	
 
/** Begin playing the next song on the playlist */
 
static void PlayPlaylistSong()
 
{
 
	if (_cur_playlist[0] == 0) {
 
		SelectSongToPlay();
 
		ResetPlaylist();
 
		/* if there is not songs in the playlist, it may indicate
 
		 * no file on the gm folder, or even no gm folder.
 
		 * Stop the playback, then */
 
@@ -268,6 +270,10 @@ void ResetMusic()
 
	DoPlaySong();
 
}
 

	
 
/**
 
 * Check music playback status and start/stop/song-finished.
 
 * Called from main loop.
 
 */
 
void MusicLoop()
 
{
 
	if (!_settings_client.music.playing && _song_is_active) {
 
@@ -426,7 +432,7 @@ struct MusicTrackSelectionWindow : publi
 
						}
 
						p[i + 1] = 0;
 
						this->SetDirty();
 
						SelectSongToPlay();
 
						ResetPlaylist();
 
						break;
 
					}
 
				}
 
@@ -445,7 +451,7 @@ struct MusicTrackSelectionWindow : publi
 
				}
 

	
 
				this->SetDirty();
 
				SelectSongToPlay();
 
				ResetPlaylist();
 
				break;
 
			}
 

	
 
@@ -453,14 +459,14 @@ struct MusicTrackSelectionWindow : publi
 
				for (uint i = 0; _playlists[_settings_client.music.playlist][i] != 0; i++) _playlists[_settings_client.music.playlist][i] = 0;
 
				this->SetDirty();
 
				StopMusic();
 
				SelectSongToPlay();
 
				ResetPlaylist();
 
				break;
 

	
 
			case WID_MTS_ALL: case WID_MTS_OLD: case WID_MTS_NEW:
 
			case WID_MTS_EZY: case WID_MTS_CUSTOM1: case WID_MTS_CUSTOM2: // set playlist
 
				SelectPlaylist(widget - WID_MTS_ALL);
 
				StopMusic();
 
				SelectSongToPlay();
 
				ResetPlaylist();
 
				break;
 
		}
 
	}
 
@@ -666,7 +672,7 @@ struct MusicWindow : public Window {
 
				this->SetWidgetLoweredState(WID_M_SHUFFLE, _settings_client.music.shuffle);
 
				this->SetWidgetDirty(WID_M_SHUFFLE);
 
				StopMusic();
 
				SelectSongToPlay();
 
				ResetPlaylist();
 
				this->SetDirty();
 
				break;
 

	
 
@@ -678,7 +684,7 @@ struct MusicWindow : public Window {
 
			case WID_M_EZY: case WID_M_CUSTOM1: case WID_M_CUSTOM2: // playlist
 
				SelectPlaylist(widget - WID_M_ALL);
 
				StopMusic();
 
				SelectSongToPlay();
 
				ResetPlaylist();
 
				this->SetDirty();
 
				break;
 
		}
0 comments (0 inline, 0 general)