Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 2d47ef9cd2
Fetching contributors…

Cannot retrieve contributors at this time

file 62 lines (56 sloc) 2.639 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
/***************************************************************************
audioprefs.h - description
-------------------
begin : Tue Jun 21 2011
copyright : (C) 2011 by Kasper Laudrup
: (C) 2011 by Kasper Laudrup
email : laudrup@stacktrace.dk
: laudrup@stacktrace.dk
***************************************************************************/

/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License version 2 *
* as published by the Free Software Foundation. *
* *
***************************************************************************/

#include "audioprefs.h"
#include "jack/jack.h"
#include "settings.h"
#include <QStringList>

AudioPrefs::AudioPrefs(QWidget* parent)
  : QWidget(parent)
{
  setupUi(this);

  jack_client_t* pJackClient;
  if ((pJackClient = jack_client_open("creox_options", JackNullOption, 0)) != 0) {
    const char** const ppInputPortList = jack_get_ports(pJackClient, 0, 0, JackPortIsInput);
      if (ppInputPortList) {
        int idx = 0;
        for (const char** ppPortCount = ppInputPortList; *ppPortCount; ++ppPortCount, ++idx) {
          QString chanName = QString::fromLatin1(*ppPortCount);
          kcfg_leftInputChannel->addItem(chanName);
          kcfg_rightInputChannel->addItem(chanName);
        }
        kcfg_leftInputChannel->setCurrentIndex(Settings::leftInputChannel());
        kcfg_rightInputChannel->setCurrentIndex(Settings::rightInputChannel());
        jack_free(ppInputPortList);
      }

      const char** const ppOutputPortList = jack_get_ports(pJackClient, 0, 0, JackPortIsOutput);
      if (ppOutputPortList) {
        int idx = 0;
        for (const char** ppPortCount = ppOutputPortList; *ppPortCount; ++ppPortCount, ++idx) {
          QString chanName = QString::fromLatin1(*ppPortCount);
          kcfg_leftOutputChannel->addItem(chanName);
          kcfg_rightOutputChannel->addItem(chanName);
        }
        kcfg_leftOutputChannel->setCurrentIndex(Settings::leftOutputChannel());
        kcfg_rightOutputChannel->setCurrentIndex(Settings::rightOutputChannel());
        jack_free(ppOutputPortList);
      }
      jack_client_close(pJackClient);
  }
}

AudioPrefs::~AudioPrefs()
{
}
Something went wrong with that request. Please try again.