Ticket #1709: mfdnew.patch
File mfdnew.patch, 12.5 KB (added by , 20 years ago) |
---|
-
settings.pro
2 2 #CONFIG += release 3 3 4 4 isEmpty( PREFIX ) { 5 PREFIX = /usr /local5 PREFIX = /usr 6 6 } 7 7 8 LIBVERSION = 0.1 88 LIBVERSION = 0.19 9 9 10 10 INCLUDEPATH += $${PREFIX}/include 11 11 -
mfd/plugins/audio/audio.cpp
45 45 // thr RTSP streamer can use to get PCM bits to send out. 46 46 // 47 47 48 output = AudioOutput::OpenAudio("NULL", 16, 2, 44100, AUDIOOUTPUT_MUSIC, true );48 output = AudioOutput::OpenAudio("NULL", 16, 2, 44100, AUDIOOUTPUT_MUSIC, true, false ); 49 49 output->bufferOutputData(true); 50 50 output->setBufferSize(output_buffer_size * 1024); 51 51 output->SetBlocking(false); … … 516 516 #else 517 517 QString adevice = gContext->GetSetting("AudioDevice"); 518 518 // TODO: Error checking that device is opened correctly! 519 output = AudioOutput::OpenAudio(adevice, 16, 2, 44100, AUDIOOUTPUT_MUSIC, true );519 output = AudioOutput::OpenAudio(adevice, 16, 2, 44100, AUDIOOUTPUT_MUSIC, true, false ); 520 520 output->setBufferSize(output_buffer_size * 1024); 521 521 output->SetBlocking(false); 522 522 output->addListener(audio_listener); -
mfd/plugins/mmusic/mmusic.cpp
526 526 527 527 MSqlQuery query(MSqlQuery::InitCon()); 528 528 529 query.exec("SELECT intid, filename FROM musicmetadata;");529 query.exec("SELECT song_id, filename FROM music_songs ;"); 530 530 531 531 if(query.isActive()) 532 532 { … … 544 544 545 545 ++count; 546 546 MSqlQuery delete_query(MSqlQuery::InitCon()); 547 delete_query.prepare("DELETE FROM music metadata WHERE intid = ?");547 delete_query.prepare("DELETE FROM music_songs WHERE song_id = ?"); 548 548 delete_query.bindValue(0, query.value(0).toUInt()); 549 549 delete_query.exec(); 550 550 log(QString("removed item %1 (\"%2\") from the database") … … 556 556 } 557 557 else 558 558 { 559 warning("something wrong with your music metadatatable");559 warning("something wrong with your music_songs table"); 560 560 } 561 561 562 562 if(count > 0) … … 638 638 639 639 MSqlQuery query(MSqlQuery::InitCon()); 640 640 641 query.exec("SELECT COUNT(filename) FROM music metadata;");641 query.exec("SELECT COUNT(filename) FROM music_songs;"); 642 642 643 643 if(!query.isActive()) 644 644 { 645 645 if(!sent_musicmetadata_table_warning) 646 646 { 647 warning("cannot get data from a table called music metadata");647 warning("cannot get data from a table called music_songs"); 648 648 sent_musicmetadata_table_warning = true; 649 649 } 650 650 return false; … … 977 977 978 978 MSqlQuery query(MSqlQuery::InitCon()); 979 979 980 query.prepare("SELECT intid, artist, album, title, genre, "980 /* query.prepare("SELECT intid, artist, album, title, genre, " 981 981 "year, tracknum, length, rating, " 982 982 "lastplay, playcount, mythdigest, size, date_added, " 983 983 "date_modified, format, description, comment, " 984 984 "compilation, composer, disc_count, disc_number, " 985 985 "track_count, start_time, stop_time, eq_preset, " 986 986 "relative_volume, sample_rate, bpm " 987 "FROM musicmetadata WHERE filename = ? ;"); 987 "FROM musicmetadata WHERE filename = ? ;");*/ 988 query.prepare("SELECT music_songs.song_id, music_artists.artist_name, " 989 "music_albums.album_name, music_songs.name, " 990 "music_genres.genre, music_songs.year, " 991 "music_songs.track, music_songs.length, " 992 "music_songs.rating, music_songs.lastplay, " 993 "music_songs.numplays, music_songs.mythdigest," 994 "music_songs.size, music_songs.date_entered, " 995 "music_songs.date_modified, music_songs.format, " 996 "music_songs.description, music_songs.comment, " 997 "music_songs.compilation, music_artists_1.artist_name AS composer, " 998 "music_songs.disc_count, music_songs.disc_number, " 999 "music_songs.track_count, music_songs.start_time, " 1000 "music_songs.stop_time, music_songs.eq_preset, " 1001 "music_songs.relative_volume, music_songs.bitrate, " 1002 "music_songs.bpm " 1003 "FROM (((music_songs INNER JOIN music_albums ON music_songs.album_id = music_albums.album_id) INNER JOIN music_artists ON music_songs.artist_id = music_artists.artist_id) INNER JOIN music_genres ON music_songs.genre_id = music_genres.genre_id) INNER JOIN music_artists AS music_artists_1 ON music_songs.compilationartist_id = music_artists_1.artist_id WHERE FILENAME = ? ;"); 988 1004 989 1005 query.bindValue(0, sqlfilename.utf8()); 990 1006 … … 1198 1214 1199 1215 MSqlQuery query(MSqlQuery::InitCon()); 1200 1216 1201 query.prepare("INSERT INTO music metadata(filename, mythdigest) "1217 query.prepare("INSERT INTO music_songs(filename, mythdigest) " 1202 1218 "values ( ? , ?)"); 1203 1219 1204 1220 query.bindValue(0, sqlfilename.utf8()); … … 1213 1229 return NULL; 1214 1230 } 1215 1231 1216 query.prepare("SELECT intid FROM musicmetadata"1232 query.prepare("SELECT song_id FROM music_songs " 1217 1233 "WHERE mythdigest = ? ;"); 1218 1234 query.bindValue(0, new_item->getMythDigest()); 1219 1235 query.exec(); … … 1322 1338 1323 1339 MSqlQuery query(MSqlQuery::InitCon()); 1324 1340 1325 query.prepare("UPDATE music metadataSET "1326 " title = ? , "1327 "artist = ? , "1328 "album = ? , "1329 "genre = ? , "1341 query.prepare("UPDATE music_songs SET " 1342 "name = ? , " 1343 "artist_id = ? , " 1344 "album_id = ? , " 1345 "genre_id = ? , " 1330 1346 "year = ? , " 1331 "track num= ? , "1347 "track = ? , " 1332 1348 "length = ? , " 1333 1349 "rating = ? , " 1334 1350 "lastplay = ? , " 1335 " playcount= ? , "1351 "numplays = ? , " 1336 1352 "mythdigest = ? , " 1337 1353 "size = ? , " 1338 "date_ added = ? , "1354 "date_entered = ? , " 1339 1355 "date_modified = ? , " 1340 1356 "format = ? , " 1341 1357 "description = ? , " 1342 1358 "comment = ? , " 1343 1359 "compilation = ? , " 1344 "comp oser= ? , "1360 "compilationartist_id = ? , " 1345 1361 "disc_count = ? , " 1346 1362 "disc_number = ? , " 1347 1363 "track_count = ? , " … … 1349 1365 "stop_time = ? , " 1350 1366 "eq_preset = ? , " 1351 1367 "relative_volume = ? , " 1352 " sample_rate = ? , "1368 "bitrate = ? , " 1353 1369 "bpm = ? " 1354 "WHERE intid = ? ;");1370 "WHERE song_id = ? ;"); 1355 1371 1356 1372 query.bindValue(0, an_item->getTitle().utf8()); 1357 1373 query.bindValue(1, an_item->getArtist().utf8()); … … 1467 1483 1468 1484 MSqlQuery query(MSqlQuery::InitCon()); 1469 1485 1470 query.prepare("SELECT name, songlist, playlistid FROM musicplaylist"1486 query.prepare("SELECT playlist_name, playlist_songs, playlist_id FROM music_saved_playlists " 1471 1487 "WHERE name != ? " 1472 "AND name != ? " 1473 "AND hostname = ? ;"); 1488 "AND name != ? ;"); 1474 1489 1475 1490 query.bindValue(0, "backup_playlist_storage"); 1476 1491 query.bindValue(1, "default_playlist_storage"); 1477 query.bindValue(2, hostname);1478 1492 1479 1493 query.exec(); 1480 1494 … … 1617 1631 1618 1632 MSqlQuery query(MSqlQuery::InitCon()); 1619 1633 1620 query.prepare("UPDATE music playlist SET songlist = ?,name = ? WHERE "1621 "playlist id = ? ;");1634 query.prepare("UPDATE music_saved_playlists SET playlist_songs = ?, playlist_name = ? WHERE " 1635 "playlist_id = ? ;"); 1622 1636 1623 1637 query.bindValue(0, db_song_list_string); 1624 1638 query.bindValue(1, a_playlist->getName().utf8()); … … 1665 1679 1666 1680 MSqlQuery query(MSqlQuery::InitCon()); 1667 1681 1668 query.prepare("INSERT INTO music playlist (name, hostname, songlist) values (?, ?, ?) ; ");1682 query.prepare("INSERT INTO music_saved_playlists (playlist_name, hostname, playlist_songs) values (?, ?, ?) ; "); 1669 1683 1670 1684 query.bindValue(0, a_playlist->getName().utf8()); 1671 1685 query.bindValue(1, hostname); … … 1681 1695 return; 1682 1696 } 1683 1697 1684 query.prepare("SELECT playlist id FROM musicplaylist WHERE name = ? AND hostname = ? AND songlist= ? ; ");1698 query.prepare("SELECT playlist_id FROM music_saved_playlists WHERE playlist_name = ? AND hostname = ? AND playlist_songs = ? ; "); 1685 1699 1686 1700 query.bindValue(0, a_playlist->getName().utf8()); 1687 1701 query.bindValue(1, hostname); … … 1776 1790 1777 1791 MSqlQuery query(MSqlQuery::InitCon()); 1778 1792 1779 query.prepare("DELETE FROM music playlist WHERE playlistid = ? ; ");1793 query.prepare("DELETE FROM music_saved_playlists WHERE playlist_id = ? ; "); 1780 1794 1781 1795 query.bindValue(0, playlist_database_id); 1782 1796 -
mfd/mfd.pro
24 24 TARGET = mfd 25 25 26 26 LIBS += -lmyth-$$LIBVERSION 27 LIBS += -lmythui-$$LIBVERSION -lGL 27 28 28 29 29 !isEmpty(USE_WMA_AUDIO){ 30 30 LIBS += -lmythavformat-$$LIBVERSION 31 31 LIBS += -lmythavcodec-$$LIBVERSION -
mfdlib/avfdecoder.cpp
232 232 233 233 if (output()) 234 234 { 235 output()->Reconfigure(16, audio_dec->channels, audio_dec->sample_rate );235 output()->Reconfigure(16, audio_dec->channels, audio_dec->sample_rate, false); 236 236 output()->SetSourceBitrate(audio_dec->bit_rate); 237 237 } 238 238 -
mfdlib/aacdecoder.cpp
383 383 384 384 if (output()) 385 385 { 386 output()->Reconfigure(16, channels, sample_rate );386 output()->Reconfigure(16, channels, sample_rate, false); 387 387 output()->SetSourceBitrate(bitrate); 388 388 } 389 389 -
mfdlib/wavdecoder.cpp
146 146 147 147 if (output()) 148 148 { 149 output()->Reconfigure(bits_per_sample, chan, freq );149 output()->Reconfigure(bits_per_sample, chan, freq, false); 150 150 output()->SetSourceBitrate(bitrate); 151 151 } 152 152 -
mfdlib/flacdecoder.cpp
157 157 158 158 if (output()) 159 159 { 160 output()->Reconfigure(bitspersample, chan, freq );160 output()->Reconfigure(bitspersample, chan, freq, false); 161 161 output()->SetSourceBitrate(44100 * 2 * 16); 162 162 } 163 163 -
mfdlib/cddecoder.cpp
175 175 176 176 if (output()) 177 177 { 178 output()->Reconfigure(16, chan, freq );178 output()->Reconfigure(16, chan, freq, false); 179 179 output()->SetSourceBitrate(44100 * 2 * 16); 180 180 } 181 181 -
mfdlib/maddecoder.cpp
132 132 133 133 if (output()) 134 134 { 135 output()->Reconfigure(16, channels, freq );135 output()->Reconfigure(16, channels, freq, false); 136 136 output()->SetSourceBitrate(bitrate); 137 137 } 138 138 -
mfdlib/vorbisdecoder.cpp
233 233 234 234 if (output()) 235 235 { 236 output()->Reconfigure(16, chan, freq);236 output()->Reconfigure(16, chan, freq, false); 237 237 output()->SetSourceBitrate(bitrate); 238 238 } 239 239