~ubuntu-branches/ubuntu/breezy/kdemultimedia/breezy

« back to all changes in this revision

Viewing changes to arts/tools/audiomanager.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2005-03-24 04:48:58 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 sarge)
  • Revision ID: james.westby@ubuntu.com-20050324044858-8ff88o9jxej6ii3d
Tags: 4:3.4.0-0ubuntu3
Add kubuntu_02_hide_arts_menu_entries.diff to hide artsbuilder and artscontrol k-menu entries

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
    /*
 
1
/*
2
2
 
3
3
    Copyright (C) 1999 Stefan Westerfeld
4
4
                       stefan@space.twc.de
 
5
                  2003 Arnold Krille
 
6
                       arnold@arnoldarts.de
5
7
 
6
8
    This program is free software; you can redistribute it and/or modify
7
9
    it under the terms of the GNU General Public License as published by
15
17
 
16
18
    You should have received a copy of the GNU General Public License
17
19
    along with this program; if not, write to the Free Software
18
 
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
20
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
19
21
 
20
22
    */
21
23
 
22
24
#include "audiomanager.h"
23
25
#include "choosebusdlg.h"
24
26
 
25
 
#include <qframe.h>
26
 
#include <qbitmap.h>
 
27
#include <qtimer.h>
 
28
#include <qlayout.h>
 
29
 
 
30
#include <klocale.h>
 
31
#include <klistview.h>
27
32
#include <kiconloader.h>
28
 
#include <qpaintdevice.h>
29
 
#include <kbuttonbox.h>
30
 
#include <klocale.h>
31
 
#include <kapp.h>
32
 
#include <stdio.h>
33
 
#include <iostream>
34
33
 
35
34
using namespace std;
36
35
 
38
37
 * as this is an 1:1 port of an old arts-0.3.4.1 artsbuilable visual widget,
39
38
 * you'll see some porting artefacts, and it's not elegance itself ;)
40
39
 */
41
 
Gui_AUDIO_MANAGER::Gui_AUDIO_MANAGER()
 
40
Gui_AUDIO_MANAGER::Gui_AUDIO_MANAGER( QWidget* parent, const char* name ) : Template_ArtsView( parent,name )
42
41
{
 
42
        this->setCaption( i18n( "Audio Manager" ) );
 
43
        this->setIcon( MainBarIcon( "artsaudiomanager", 32 ) );
43
44
        //printf("constructor\n");
44
45
        ParentWidget = 0;
45
46
        listview = 0;
54
55
 
55
56
        QTimer *updatetimer = new QTimer(this);
56
57
        updatetimer->start(500);
57
 
        connect(updatetimer,SIGNAL(timeout()),this,SLOT(tick()));
 
58
        QObject::connect(updatetimer,SIGNAL(timeout()),this,SLOT(tick()));
58
59
}
59
60
 
60
61
Gui_AUDIO_MANAGER::~Gui_AUDIO_MANAGER()
63
64
        delete proxy;
64
65
}
65
66
 
66
 
void Gui_AUDIO_MANAGER::closeEvent(QCloseEvent *e)
67
 
{
68
 
        e->accept();
69
 
        //cout << "close()" << endl;
70
 
        emit closed();
71
 
}
72
 
 
73
 
 
74
67
#if 0
75
68
void Gui_AUDIO_MANAGER::widgetDestroyed(QWidget *widget)
76
69
{
79
72
}
80
73
#endif
81
74
 
82
 
void Gui_AUDIO_MANAGER::setParent(QWidget *parent, QBoxLayout *layout)
 
75
void Gui_AUDIO_MANAGER::setParent(QWidget *parent, QBoxLayout * /*layout*/)
83
76
{
84
77
/************************************************************************
85
78
 * From Gui_INSTRUMENT_MAPPER:
102
95
 
103
96
// list
104
97
 
105
 
        listview = new QListView(parent);
 
98
        listview = new KListView(parent);
106
99
 
107
100
        listview->addColumn(i18n("Title"),175);
108
101
        listview->addColumn(i18n("Type"),50);
109
 
        listview->addColumn(i18n("Destination"),75);
 
102
        listview->addColumn(i18n("Bus"),75);
110
103
 
111
104
        listview->setMinimumSize(300,100);
112
105
 
113
 
        QObject::connect(listview,SIGNAL(doubleClicked(QListViewItem *)),proxy,
 
106
        QObject::connect(listview,SIGNAL(executed(QListViewItem *)),proxy,
114
107
                                                                SLOT(edit(QListViewItem *)));
115
108
 
116
109
        mainlayout->addWidget(listview);
122
115
 
123
116
void Gui_AUDIO_MANAGER::tick()
124
117
{
125
 
        long newChanges = AudioManager.changes();
 
118
        unsigned long newChanges = AudioManager.changes();
126
119
        if(inDialog) return;
127
120
        if(changes == newChanges) return;
128
121
 
157
150
        assert(cd);
158
151
 
159
152
        inDialog = true;
160
 
        bool accept = cd->exec();
 
153
        int accept = cd->exec();
161
154
        inDialog = false;
162
155
 
163
 
        if(accept)
 
156
        if( accept == QDialog::Accepted )
164
157
        {
165
158
                QString result = cd->result();
166
159
                if(!result.isNull())
201
194
        //
202
195
}
203
196
#include "audiomanager.moc"
 
197
 
 
198
// vim: sw=4 ts=4