~ubuntu-branches/ubuntu/gutsy/kdebase-workspace/gutsy-backports

« back to all changes in this revision

Viewing changes to khotkeys/kcontrol/voicerecorder.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2007-09-05 20:45:14 UTC
  • Revision ID: james.westby@ubuntu.com-20070905204514-632hhspl0nvrc84i
Tags: upstream-3.93.0
ImportĀ upstreamĀ versionĀ 3.93.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/****************************************************************************
 
2
 
 
3
 KHotKeys
 
4
 
 
5
 Copyright (C) 2005 Olivier Goffgart <ogoffart @ kde.org>
 
6
 
 
7
 Distributed under the terms of the GNU General Public License version 2.
 
8
 
 
9
****************************************************************************/
 
10
 
 
11
#ifndef VOICE_RECORDER_H
 
12
#define VOICE_RECORDER_H
 
13
 
 
14
#include <QtGui/QFrame>
 
15
#include "voice_input_widget_ui.h"
 
16
 
 
17
 
 
18
#include "sound.h"
 
19
class  KAudioRecordStream ;
 
20
class KTemporaryFile;
 
21
class KLibrary;
 
22
 
 
23
namespace KHotKeys
 
24
{
 
25
 
 
26
        class SoundRecorder;
 
27
        
 
28
class VoiceRecorder : public Voice_input_widget_ui
 
29
    {
 
30
    Q_OBJECT
 
31
 
 
32
    public:
 
33
        VoiceRecorder(const Sound& sound_P, const QString &voiceId, QWidget *parent, const char *name);
 
34
        ~VoiceRecorder();
 
35
 
 
36
        Sound sound() const;
 
37
                
 
38
        enum State { sNotModified , sIncorrect, sModified  };
 
39
 
 
40
        inline State state() const
 
41
            {
 
42
            return _state;
 
43
            }
 
44
            
 
45
        static bool init( KLibrary* lib );
 
46
        typedef void (*arts_play_fun)( const QString& file );
 
47
 
 
48
    protected slots:
 
49
        void slotStopPressed();
 
50
        void slotRecordPressed();
 
51
        void slotPlayPressed();
 
52
 
 
53
    signals:
 
54
        void recorded(bool);
 
55
        private slots:
 
56
        void slotSoundRecorded(const Sound& sound);
 
57
        bool drawSound();
 
58
 
 
59
    private:
 
60
        SoundRecorder *_recorder;
 
61
        Sound _sound;
 
62
        State _state;
 
63
        KTemporaryFile *_tempFile;
 
64
        QString _voiceId;
 
65
        static arts_play_fun arts_play;
 
66
    };
 
67
 
 
68
} // namespace KHotKeys
 
69
 
 
70
#endif