Ticket #1143: mythmusic_audio.patch

File mythmusic_audio.patch, 2.1 KB (added by stuart@…, 14 years ago)

Reverts [8864] and adds a new value of 'default' to the mythmusic Audio Device field

  • mythmusic/mythmusic/playbackbox.cpp

     
    17881788
    17891789void PlaybackBoxMusic::openOutputDevice(void)
    17901790{
    1791     QString adevice = gContext->GetSetting("AudioOutputDevice");
     1791    QString adevice;
     1792
     1793    if (gContext->GetSetting("AudioDevice") == "default")
     1794        adevice = gContext->GetSetting("AudioOutputDevice");
     1795    else
     1796        adevice = gContext->GetSetting("AudioDevice");
    17921797   
    17931798    // TODO: Error checking that device is opened correctly!
    17941799    output = AudioOutput::OpenAudio(adevice, 16, 2, 44100,
  • mythmusic/mythmusic/globalsettings.cpp

     
    2525    return gc;
    2626};
    2727
     28static HostComboBox *MusicAudioDevice()
     29{
     30    HostComboBox *gc = new HostComboBox("AudioDevice", true);
     31    gc->setLabel(QObject::tr("Audio device"));
     32    gc->addSelection(QObject::tr("default"), "default");
     33    QDir dev("/dev", "dsp*", QDir::Name, QDir::System);
     34    gc->fillSelectionsFromDir(dev);
     35    dev.setNameFilter("adsp*");
     36    gc->fillSelectionsFromDir(dev);
     37
     38    dev.setNameFilter("dsp*");
     39    dev.setPath("/dev/sound");
     40    gc->fillSelectionsFromDir(dev);
     41    dev.setNameFilter("adsp*");
     42    gc->fillSelectionsFromDir(dev);
     43    gc->setHelpText(QObject::tr("Audio Device used for playback. 'default' will use the device specified in MythTV"));
     44    return gc;
     45};
     46
    2847static HostComboBox *CDDevice()
    2948{
    3049    HostComboBox *gc = new HostComboBox("CDDevice", true);
     
    528547    VerticalConfigurationGroup* general = new VerticalConfigurationGroup(false);
    529548    general->setLabel(QObject::tr("General Settings"));
    530549    general->addChild(SetMusicDirectory());
     550    general->addChild(MusicAudioDevice());
    531551    general->addChild(CDDevice());
    532552    general->addChild(TreeLevels());
    533553    general->addChild(NonID3FileNameFormat());