1 #include "bcprogressbox.h"
7 #define _(String) gettext(String)
8 #define gettext_noop(String) String
9 #define N_(String) gettext_noop (String)
13 DC_Offset::DC_Offset()
16 getting_dc_offset = 0;
17 for(int i = 0; i < MAXCHANNELS; i++) dc_offset[i] = 0;
18 dc_offset_lock = new Mutex;
21 DC_Offset::~DC_Offset()
23 delete dc_offset_lock;
26 int DC_Offset::calibrate_dc_offset(int *output, RecordGUIDCOffsetText **dc_offset_text, int input_channels)
28 this->output = output;
29 this->dc_offset_text = dc_offset_text;
30 this->input_channels = input_channels;
37 // thread out progress box
38 progress = new BC_ProgressBox((int)BC_INFINITY,
44 dc_offset_lock->lock();
46 for(int i = 0; i < input_channels; i++)
48 dc_offset_total[i] = 0;
51 getting_dc_offset = 1;
53 dc_offset_lock->lock(); // wait for result
54 dc_offset_lock->unlock();
56 // thread in progress box
57 progress->stop_progress();
64 for(i = 0; i < input_channels; i++) output[i] = dc_offset[i];
65 for(i = 0; i < input_channels; i++)
67 sprintf(string, "%ld", dc_offset[i]);
68 dc_offset_text[i]->update(string);
75 // c-file-style: "linux"