MCPcopy Create free account
hub / github.com/Greedysky/TTKMusicPlayer / readSystemConfigFromFile

Method readSystemConfigFromFile

TTKModule/musicapplication.cpp:1101–1244  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1099}
1100
1101void MusicApplication::readSystemConfigFromFile()
1102{
1103 int value = TTK_NORMAL_LEVEL;
1104 //Path configuration song
1105 MusicSongItemList items;
1106 {
1107 MusicTKPLConfigManager manager;
1108 if(manager.fromFile(PLAYLIST_PATH_FULL))
1109 {
1110 manager.readBuffer(items);
1111 }
1112 }
1113
1114 MusicConfigManager manager;
1115 if(!manager.fromFile(COFIG_PATH_FULL))
1116 {
1117 TTK_ERROR_STREAM("Load config file error:" << COFIG_PATH_FULL);
1118 return;
1119 }
1120
1121 manager.readBuffer();
1122
1123 m_applicationModule->loadNetWorkSetting();
1124 const bool success = m_songTreeWidget->addSongItemList(items);
1125
1126 switch(TTKStaticCast(TTK::PlayMode, G_SETTING_PTR->value(MusicSettingManager::PlayMode).toInt()))
1127 {
1128 case TTK::PlayMode::Order: playOrder();break;
1129 case TTK::PlayMode::Random: playRandom();break;
1130 case TTK::PlayMode::ListLoop: playlistLoop();break;
1131 case TTK::PlayMode::OneLoop: playOneLoop();break;
1132 case TTK::PlayMode::Once: playOnce();break;
1133 default:break;
1134 }
1135
1136 value = G_SETTING_PTR->value(MusicSettingManager::RemoteWidgetMode).toInt();
1137 if(value != 0)
1138 {
1139 m_topAreaWidget->remoteTypeChanged(value);
1140 }
1141
1142 //The size of the volume of the allocation of songs
1143 volumeChanged(G_SETTING_PTR->value(MusicSettingManager::Volume).toInt());
1144
1145 //Configure playback mode
1146 m_ui->enhancedButton->setEnhancedSongConfig(G_SETTING_PTR->value(MusicSettingManager::EnhancedMusicIndex).toInt());
1147 m_applicationModule->updateSoundEffectConfig(true);
1148 if(G_SETTING_PTR->value(MusicSettingManager::EqualizerEnable).toInt() == 1)
1149 {
1150 m_player->setEqualizerConfig();
1151 }
1152
1153 //global hotkey
1154 if(G_SETTING_PTR->value(MusicSettingManager::HotkeyEnable).toBool())
1155 {
1156 QStringList hotkeys = G_SETTING_PTR->value(MusicSettingManager::HotkeyValue).toString().split(TTK_SPLITER);
1157 if(hotkeys.count() != G_HOTKEY_PTR->count())
1158 {

Callers

nothing calls this directly

Calls 15

loadNetWorkSettingMethod · 0.80
addSongItemListMethod · 0.80
remoteTypeChangedMethod · 0.80
setEnhancedSongConfigMethod · 0.80
setEqualizerConfigMethod · 0.80
defaultKeysMethod · 0.80
setHotKeyMethod · 0.80
setInteriorLrcVisibleMethod · 0.80

Tested by

no test coverage detected