Ticket #1709: mfdnew.patch

File mfdnew.patch, 12.5 KB (added by jochen, 20 years ago)
  • settings.pro

     
    22#CONFIG += release
    33
    44isEmpty( PREFIX ) {
    5     PREFIX = /usr/local
     5    PREFIX = /usr
    66}
    77
    8 LIBVERSION = 0.18
     8LIBVERSION = 0.19
    99
    1010INCLUDEPATH += $${PREFIX}/include
    1111
  • mfd/plugins/audio/audio.cpp

     
    4545    //  thr RTSP streamer can use to get PCM bits to send out.
    4646    //
    4747
    48     output = AudioOutput::OpenAudio("NULL", 16, 2, 44100, AUDIOOUTPUT_MUSIC, true );
     48    output = AudioOutput::OpenAudio("NULL", 16, 2, 44100, AUDIOOUTPUT_MUSIC, true, false );
    4949    output->bufferOutputData(true);
    5050    output->setBufferSize(output_buffer_size * 1024);
    5151    output->SetBlocking(false);
     
    516516#else
    517517            QString adevice = gContext->GetSetting("AudioDevice");
    518518            // 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 );
    520520            output->setBufferSize(output_buffer_size * 1024);
    521521            output->SetBlocking(false);
    522522            output->addListener(audio_listener);
  • mfd/plugins/mmusic/mmusic.cpp

     
    526526   
    527527    MSqlQuery query(MSqlQuery::InitCon());
    528528   
    529     query.exec("SELECT intid, filename FROM musicmetadata ;");
     529    query.exec("SELECT song_id, filename FROM music_songs ;");
    530530   
    531531    if(query.isActive())
    532532    {
     
    544544
    545545                    ++count;
    546546                    MSqlQuery delete_query(MSqlQuery::InitCon());
    547                     delete_query.prepare("DELETE FROM musicmetadata WHERE intid = ?");
     547                    delete_query.prepare("DELETE FROM music_songs WHERE song_id = ?");
    548548                    delete_query.bindValue(0, query.value(0).toUInt());
    549549                    delete_query.exec();
    550550                    log(QString("removed item %1 (\"%2\") from the database")
     
    556556    }
    557557    else
    558558    {
    559         warning("something wrong with your musicmetadata table");
     559        warning("something wrong with your music_songs table");
    560560    }
    561561   
    562562    if(count > 0)
     
    638638   
    639639    MSqlQuery query(MSqlQuery::InitCon());
    640640   
    641     query.exec("SELECT COUNT(filename) FROM musicmetadata;");
     641    query.exec("SELECT COUNT(filename) FROM music_songs;");
    642642   
    643643    if(!query.isActive())
    644644    {
    645645        if(!sent_musicmetadata_table_warning)
    646646        {
    647             warning("cannot get data from a table called musicmetadata");
     647            warning("cannot get data from a table called music_songs");
    648648            sent_musicmetadata_table_warning = true;
    649649        }
    650650        return false;
     
    977977
    978978    MSqlQuery query(MSqlQuery::InitCon());
    979979
    980     query.prepare("SELECT intid, artist, album, title, genre, "
     980/*    query.prepare("SELECT intid, artist, album, title, genre, "
    981981                  "year, tracknum, length, rating, "
    982982                  "lastplay, playcount, mythdigest, size, date_added, "
    983983                  "date_modified, format, description, comment, "
    984984                  "compilation, composer, disc_count, disc_number, "
    985985                  "track_count, start_time, stop_time, eq_preset, "
    986986                  "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 = ? ;");
    9881004
    9891005    query.bindValue(0, sqlfilename.utf8());
    9901006   
     
    11981214       
    11991215        MSqlQuery query(MSqlQuery::InitCon());
    12001216
    1201         query.prepare("INSERT INTO musicmetadata (filename, mythdigest) "
     1217        query.prepare("INSERT INTO music_songs(filename, mythdigest) "
    12021218                      "values ( ? , ?)");
    12031219
    12041220        query.bindValue(0, sqlfilename.utf8());
     
    12131229            return NULL;
    12141230        }
    12151231       
    1216         query.prepare("SELECT intid FROM musicmetadata "
     1232        query.prepare("SELECT song_id FROM music_songs "
    12171233                               "WHERE mythdigest = ? ;");
    12181234        query.bindValue(0, new_item->getMythDigest());
    12191235        query.exec();
     
    13221338
    13231339    MSqlQuery query(MSqlQuery::InitCon());
    13241340
    1325     query.prepare("UPDATE musicmetadata SET "
    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 = ? , "
    13301346                  "year = ? , "
    1331                   "tracknum = ? , "
     1347                  "track = ? , "
    13321348                  "length = ? , "
    13331349                  "rating = ? , "
    13341350                  "lastplay = ? , "
    1335                   "playcount = ? , "
     1351                  "numplays = ? , "
    13361352                  "mythdigest = ? , "
    13371353                  "size = ? , "
    1338                   "date_added = ? , "
     1354                  "date_entered = ? , "
    13391355                  "date_modified = ? , "
    13401356                  "format = ? , "
    13411357                  "description = ? , "
    13421358                  "comment = ? , "
    13431359                  "compilation = ? , "
    1344                   "composer = ? , "
     1360                  "compilationartist_id = ? , "
    13451361                  "disc_count = ? , "
    13461362                  "disc_number = ? , "
    13471363                  "track_count = ? , "
     
    13491365                  "stop_time = ? , "
    13501366                  "eq_preset = ? , "
    13511367                  "relative_volume = ? , "
    1352                   "sample_rate = ? , "
     1368                  "bitrate = ? , "
    13531369                  "bpm = ?  "
    1354                   "WHERE intid = ? ;");
     1370                  "WHERE song_id = ? ;");
    13551371
    13561372    query.bindValue(0,  an_item->getTitle().utf8());
    13571373    query.bindValue(1,  an_item->getArtist().utf8());
     
    14671483
    14681484    MSqlQuery query(MSqlQuery::InitCon());
    14691485
    1470     query.prepare("SELECT name, songlist, playlistid FROM musicplaylist "
     1486    query.prepare("SELECT playlist_name, playlist_songs, playlist_id FROM music_saved_playlists "
    14711487                  "WHERE name != ? "
    1472                   "AND name != ? "
    1473                   "AND hostname = ? ;");
     1488                  "AND name != ? ;");
    14741489       
    14751490    query.bindValue(0, "backup_playlist_storage");
    14761491    query.bindValue(1, "default_playlist_storage");
    1477     query.bindValue(2, hostname);
    14781492       
    14791493    query.exec();
    14801494
     
    16171631   
    16181632    MSqlQuery query(MSqlQuery::InitCon());
    16191633
    1620     query.prepare("UPDATE musicplaylist SET songlist = ?, name = ? WHERE "
    1621                   "playlistid = ? ;");
     1634    query.prepare("UPDATE music_saved_playlists SET playlist_songs = ?, playlist_name = ? WHERE "
     1635                  "playlist_id = ? ;");
    16221636
    16231637    query.bindValue(0, db_song_list_string);
    16241638    query.bindValue(1, a_playlist->getName().utf8());
     
    16651679   
    16661680    MSqlQuery query(MSqlQuery::InitCon());
    16671681
    1668     query.prepare("INSERT INTO musicplaylist (name, hostname, songlist) values (?, ?, ?) ; ");
     1682    query.prepare("INSERT INTO music_saved_playlists (playlist_name, hostname, playlist_songs) values (?, ?, ?) ; ");
    16691683
    16701684    query.bindValue(0, a_playlist->getName().utf8());
    16711685    query.bindValue(1, hostname);
     
    16811695        return;
    16821696    }
    16831697   
    1684     query.prepare("SELECT playlistid 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 = ? ; ");
    16851699
    16861700    query.bindValue(0, a_playlist->getName().utf8());
    16871701    query.bindValue(1, hostname);
     
    17761790
    17771791    MSqlQuery query(MSqlQuery::InitCon());
    17781792
    1779     query.prepare("DELETE FROM musicplaylist WHERE playlistid = ? ; ");
     1793    query.prepare("DELETE FROM music_saved_playlists WHERE playlist_id = ? ; ");
    17801794
    17811795    query.bindValue(0, playlist_database_id);
    17821796       
  • mfd/mfd.pro

     
    2424TARGET = mfd
    2525
    2626LIBS += -lmyth-$$LIBVERSION
     27LIBS += -lmythui-$$LIBVERSION -lGL
    2728
    28 
    2929!isEmpty(USE_WMA_AUDIO){
    3030LIBS += -lmythavformat-$$LIBVERSION
    3131LIBS += -lmythavcodec-$$LIBVERSION
  • mfdlib/avfdecoder.cpp

     
    232232
    233233    if (output())
    234234    {
    235         output()->Reconfigure(16, audio_dec->channels, audio_dec->sample_rate);
     235        output()->Reconfigure(16, audio_dec->channels, audio_dec->sample_rate, false);
    236236        output()->SetSourceBitrate(audio_dec->bit_rate);
    237237    }
    238238
  • mfdlib/aacdecoder.cpp

     
    383383
    384384    if (output())
    385385    {
    386         output()->Reconfigure(16, channels, sample_rate);
     386        output()->Reconfigure(16, channels, sample_rate, false);
    387387        output()->SetSourceBitrate(bitrate);
    388388    }
    389389
  • mfdlib/wavdecoder.cpp

     
    146146
    147147    if (output())
    148148    {
    149         output()->Reconfigure(bits_per_sample, chan, freq);
     149        output()->Reconfigure(bits_per_sample, chan, freq, false);
    150150        output()->SetSourceBitrate(bitrate);
    151151    }
    152152
  • mfdlib/flacdecoder.cpp

     
    157157   
    158158    if (output())
    159159    {
    160         output()->Reconfigure(bitspersample, chan, freq);
     160        output()->Reconfigure(bitspersample, chan, freq, false);
    161161        output()->SetSourceBitrate(44100 * 2 * 16);
    162162    }
    163163
  • mfdlib/cddecoder.cpp

     
    175175
    176176    if (output())
    177177    {
    178         output()->Reconfigure(16, chan, freq);
     178        output()->Reconfigure(16, chan, freq, false);
    179179        output()->SetSourceBitrate(44100 * 2 * 16);
    180180    }
    181181
  • mfdlib/maddecoder.cpp

     
    132132
    133133    if (output())
    134134    {
    135         output()->Reconfigure(16, channels, freq);
     135        output()->Reconfigure(16, channels, freq, false);
    136136        output()->SetSourceBitrate(bitrate);
    137137    }
    138138
  • mfdlib/vorbisdecoder.cpp

     
    233233
    234234    if (output())
    235235    {
    236         output()->Reconfigure(16, chan, freq);
     236        output()->Reconfigure(16, chan, freq, false);
    237237        output()->SetSourceBitrate(bitrate);
    238238    }
    239239