aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/Input/cue/decoder_cue.cpp
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2021-01-07 17:49:56 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2021-01-07 17:49:56 +0000
commit1a13270970c4194a0f3c306c0a9bb8e72e42c1fd (patch)
tree891a6bb950a490c6532d8b7e6c5c2d6deb51e269 /src/plugins/Input/cue/decoder_cue.cpp
parent26c0acfe811b4494d4aeb0763362eedddcff4806 (diff)
downloadqmmp-1a13270970c4194a0f3c306c0a9bb8e72e42c1fd.tar.gz
qmmp-1a13270970c4194a0f3c306c0a9bb8e72e42c1fd.tar.bz2
qmmp-1a13270970c4194a0f3c306c0a9bb8e72e42c1fd.zip
updated cmake files
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@9619 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/Input/cue/decoder_cue.cpp')
0 files changed, 0 insertions, 0 deletions
e032-0410-971d-27865f9a5e38> 2010-01-23 15:17:59 +0000 fixed problems with alsa < 1.22.00' href='/qmmp/commit/src/plugins/Output/alsa/settingsdialog.cpp?id=69f4840a192587d72fee046f3282338589ebcd3f'>69f4840a1
013ee07b5
2d622fd9b
81a8ff3c3
2d622fd9b
2d622fd9b
ae75e5707
2d622fd9b















11b7655bb

2d622fd9b































81a8ff3c3

b917024aa
81a8ff3c3




3c37f7453
81a8ff3c3






















2d622fd9b



















7b7e7b4bd
2d622fd9b



































3b7ba10ae
2d622fd9b


6c95ea127
2d622fd9b





2d622fd9b


9597e2240
2d622fd9b


















fcc385fc5
2d622fd9b

ae75e5707
2d622fd9b



7b7e7b4bd




2d622fd9b
3202566a0
738476128
2d622fd9b
fcc385fc5
2d622fd9b



2d622fd9b

2d622fd9b






501a20123
2d622fd9b

3ab1dc435
2d622fd9b

b917024aa
2d622fd9b











b917024aa
2d622fd9b






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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
                                                                            
                                                                            
                                                                            













                                                                            
                                                                            

                                                                             
                      










                                                  

                                        
                                          
               
                     
                                                                           
                                                                                       
                                                                 















                                                                                  

                                                                                      































                                                                         

                                     
                           




                                                   
                            






















                                                                               



















                                                                         
                                                



































                                                                                   
                                     


                                        
                    





                                                  


                              
                                   


















                                                              
                             

                                                      
                                                                 



                                                                   




                                                                        
                                                                              
                                                                
                                                                          
                        
                      



                                                               

            






                                                                       
                                                                          

                                                            
                                                                                           

                  
                                                                       











                                                                                     
                               






                                            
/***************************************************************************
 *   Copyright (C) 2006-2019 by Ilya Kotov                                 *
 *   forkotov02@ya.ru                                                      *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
 ***************************************************************************/
#include <QSettings>
#include <qmmp/qmmp.h>

extern "C"
{
#include <alsa/asoundlib.h>
}

#include "settingsdialog.h"

SettingsDialog::SettingsDialog ( QWidget *parent )
        : QDialog ( parent )
{
    ui.setupUi (this);
    setAttribute (Qt::WA_DeleteOnClose);
    ui.deviceComboBox->setEditable (true);
    getCards();
    getSoftDevices();
    connect (ui.deviceComboBox, SIGNAL(activated(int)),SLOT(setText(int)));
    connect(ui.mixerCardComboBox, SIGNAL(activated(int)), SLOT(showMixerDevices(int)));
    QSettings settings(Qmmp::configFile(), QSettings::IniFormat);
    settings.beginGroup("ALSA");
    ui.deviceComboBox->setEditText(settings.value("device","default").toString());
    ui.bufferSpinBox->setValue(settings.value("buffer_time",500).toInt());
    ui.periodSpinBox->setValue(settings.value("period_time",100).toInt());

    int d = m_cards.indexOf(settings.value("mixer_card","hw:0").toString());
    if (d >= 0)
        ui.mixerCardComboBox->setCurrentIndex(d);

    showMixerDevices(ui.mixerCardComboBox->currentIndex ());
    d = ui.mixerDeviceComboBox->findText(settings.value("mixer_device",
                                         "PCM").toString());

    if (d >= 0)
        ui.mixerDeviceComboBox->setCurrentIndex(d);

    ui.mmapCheckBox->setChecked(settings.value("use_mmap", false).toBool());
    ui.pauseCheckBox->setChecked(settings.value("use_snd_pcm_pause", false).toBool());
    settings.endGroup();
}


SettingsDialog::~SettingsDialog()
{}

void SettingsDialog::getCards()
{
    int card = -1, err;

    m_devices.clear();
    m_devices << "default";
    ui.deviceComboBox->addItem("Default PCM device (default)");

    if ((err = snd_card_next(&card)) !=0)
        qWarning("SettingsDialog (ALSA): snd_next_card() failed: %s",
                 snd_strerror(-err));

    while (card > -1)
    {
        getCardDevices(card);
        m_cards << QString("hw:%1").arg(card);
        if ((err = snd_card_next(&card)) !=0)
        {
            qWarning("SettingsDialog (ALSA): snd_next_card() failed: %s",
                     snd_strerror(-err));
            break;
        }
    }
}

void SettingsDialog::getSoftDevices()
{
    void **hints = nullptr;
    int i = 0;

    if(snd_device_name_hint(-1, "pcm", &hints) < 0)
        return;

    while(hints && hints[i])
    {
        char *type = snd_device_name_get_hint (hints[i], "IOID");
        if (!type || !strcmp (type, "Output"))
        {
            char *device_name = snd_device_name_get_hint (hints[i], "NAME");
            char *device_desc = snd_device_name_get_hint (hints[i], "DESC");

            m_devices << QString(device_name);
            QString str = QString("%1 (%2)").arg(device_desc).arg(device_name);
            qDebug("%s", qPrintable(str));
            ui.deviceComboBox->addItem(str);
            free (device_name);
            free (device_desc);
        }
        if(type)
            free (type);
        ++i;
    }

    if (hints)
        snd_device_name_free_hint (hints);
}

void SettingsDialog::getCardDevices(int card)
{
    int pcm_device = -1, err;
    snd_pcm_info_t *pcm_info;
    snd_ctl_t *ctl;
    char dev[64], *card_name;

    sprintf(dev, "hw:%i", card);

    if ((err = snd_ctl_open(&ctl, dev, 0)) < 0)
    {
        qWarning("SettingsDialog (ALSA): snd_ctl_open() failed: %s",
                 snd_strerror(-err));
        return;
    }

    if ((err = snd_card_get_name(card, &card_name)) != 0)
    {
        qWarning("SettingsDialog (ALSA): snd_card_get_name() failed: %s",
                 snd_strerror(-err));
        card_name = strdup("Unknown soundcard");
    }
    ui.mixerCardComboBox->addItem(QString(card_name));

    snd_pcm_info_alloca(&pcm_info);

    qDebug("SettingsDialog (ALSA): detected sound cards:");

    for (;;)
    {
        QString device;
        if ((err = snd_ctl_pcm_next_device(ctl, &pcm_device)) < 0)
        {