r125: This commit was manufactured by cvs2svn to create tag 'r1_1_7-last'.
[cinelerra_cv/mob.git] / hvirtual / cinelerra / audioinprefs.C
blob1ac450d085bcd298642e22a07c259707601d62c9
1 #include "adeviceprefs.h"
2 #include "audioconfig.h"
3 #include "audioinprefs.h"
4 #include "clip.h"
5 #include "edl.h"
6 #include "edlsession.h"
7 #include "new.h"
8 #include "preferences.h"
9 #include "recordconfig.h"
10 #include "vdeviceprefs.h"
12 AudioInPrefs::AudioInPrefs(MWindow *mwindow, PreferencesWindow *pwindow)
13  : PreferencesDialog(mwindow, pwindow)
15         this->mwindow = mwindow;
18 AudioInPrefs::~AudioInPrefs()
20         delete in_device;
21         delete duplex_device;
24 int AudioInPrefs::create_objects()
26         int x = 5, y = 5;
27         char string[1024];
29         add_subwindow(new BC_Title(x, y, "Audio In", LARGEFONT, BLACK));
30         y += 25;
33         add_subwindow(new BC_Title(x, y, "Record Driver:", MEDIUMFONT, BLACK));
34         in_device = new ADevicePrefs(x + 110, 
35                 y, 
36                 pwindow, 
37                 this, 
38                 0,
39                 pwindow->thread->edl->session->aconfig_in, 
40                 MODERECORD);
41         in_device->initialize();
43         y += ADevicePrefs::get_h();
45         add_subwindow(new BC_Title(x, y, "Duplex Driver:", MEDIUMFONT, BLACK));
46         duplex_device = new ADevicePrefs(x + 110, 
47                 y, 
48                 pwindow, 
49                 this, 
50                 pwindow->thread->edl->session->aconfig_duplex, 
51                 0,
52                 MODEDUPLEX);
53         duplex_device->initialize();
55         y += ADevicePrefs::get_h();
56         BC_TextBox *textbox;
57         add_subwindow(new BC_Title(x, y, "Samples to write to disk at a time:"));
58         sprintf(string, "%lld", pwindow->thread->edl->session->record_write_length);
59         add_subwindow(textbox = new RecordWriteLength(mwindow, pwindow, x + 240, y, string));
61         y += 30;
62         add_subwindow(new BC_Title(x, y, "Be sure to allocate enough samples to allow video compression."));
63         y += 30;
64         add_subwindow(new DuplexEnable(mwindow, pwindow, x, y, pwindow->thread->edl->session->enable_duplex));
65         y += 30;
66         add_subwindow(new RecordRealTime(mwindow, pwindow, x, y, pwindow->thread->edl->session->real_time_record));
67         y += 45;
70         return 0;
74 RecordWriteLength::RecordWriteLength(MWindow *mwindow, PreferencesWindow *pwindow, int x, int y, char *text)
75  : BC_TextBox(x, y, 100, 1, text)
76
77         this->pwindow = pwindow; 
80 int RecordWriteLength::handle_event()
81
82         pwindow->thread->edl->session->record_write_length = atol(get_text());
83         return 1; 
88 RecordRealTime::RecordRealTime(MWindow *mwindow, PreferencesWindow *pwindow, int x, int y, int value)
89  : BC_CheckBox(x, y, value, "Record in realtime priority (root only)")
90
91         this->pwindow = pwindow; 
94 int RecordRealTime::handle_event()
96         pwindow->thread->edl->session->real_time_record = get_value();
99 DuplexEnable::DuplexEnable(MWindow *mwindow, PreferencesWindow *pwindow, int x, int y, int value)
100  : BC_CheckBox(x, y, value, "Enable full duplex")
101 { this->pwindow = pwindow; }
103 int DuplexEnable::handle_event()
105         pwindow->thread->edl->session->enable_duplex = get_value();