2015-09-05 Fred Gleason <fredg@paravelsystems.com>

* Added 'PCM24' to the list of available formats in
	'rdadmin/edit_rdlogedit.cpp' and 'rdadmin/edit_rdlogedit.h'.
	* Added PCM24 support for voice tracking in
	'rdlogedit/voice_tracker.cpp'.
This commit is contained in:
Fred Gleason
2015-09-05 09:40:52 -04:00
parent 07869f9ee9
commit 4de09b9eaf
11 changed files with 196 additions and 241 deletions

View File

@@ -2,9 +2,7 @@
//
// Edit an RDLogedit Configuration
//
// (C) Copyright 2002-2005 Fred Gleason <fredg@paravelsystems.com>
//
// $Id: edit_rdlogedit.cpp,v 1.18.6.2 2014/01/08 18:14:35 cvs Exp $
// (C) Copyright 2002-2015 Fred Gleason <fredg@paravelsystems.com>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
@@ -42,8 +40,8 @@
EditRDLogedit::EditRDLogedit(RDStation *station,RDStation *cae_station,
QWidget *parent,const char *name)
: QDialog(parent,name,true)
QWidget *parent)
: QDialog(parent,"",true)
{
//
// Fix the Window Size
@@ -71,9 +69,9 @@ EditRDLogedit::EditRDLogedit(RDStation *station,RDStation *cae_station,
//
// Input Configuration
//
lib_input_card=new RDCardSelector(this,"lib_input_card");
lib_input_card=new RDCardSelector(this);
lib_input_card->setGeometry(10,29,120,117);
QLabel *label=new QLabel(lib_input_card,tr("INPUT"),this,"lib_input_label");
QLabel *label=new QLabel(lib_input_card,tr("INPUT"),this);
label->setGeometry(10,10,110,19);
label->setFont(big_font);
label->setAlignment(AlignCenter);
@@ -81,9 +79,9 @@ EditRDLogedit::EditRDLogedit(RDStation *station,RDStation *cae_station,
//
// Output Configuration
//
lib_output_card=new RDCardSelector(this,"lib_output_card");
lib_output_card=new RDCardSelector(this);
lib_output_card->setGeometry(170,29,120,87);
label=new QLabel(lib_output_card,tr("OUTPUT"),this,"lib_output_label");
label=new QLabel(lib_output_card,tr("OUTPUT"),this);
label->setGeometry(170,10,110,19);
label->setFont(big_font);
label->setAlignment(AlignCenter);
@@ -91,7 +89,7 @@ EditRDLogedit::EditRDLogedit(RDStation *station,RDStation *cae_station,
//
// Settings
//
QLabel *setting_label=new QLabel(tr("Voice Tracker Settings"),this,"setting_label");
QLabel *setting_label=new QLabel(tr("Voice Tracker Settings"),this);
setting_label->setGeometry(70,79,sizeHint().width()-80,19);
setting_label->setFont(big_font);
setting_label->setAlignment(AlignLeft|ShowPrefix);
@@ -99,80 +97,73 @@ EditRDLogedit::EditRDLogedit(RDStation *station,RDStation *cae_station,
//
// Maximum Record Length
//
lib_maxlength_time=new QTimeEdit(this,"lib_maxlength_time");
lib_maxlength_time=new QTimeEdit(this);
lib_maxlength_time->setGeometry(160,100,85,19);
QLabel *lib_maxlength_label=new QLabel(lib_maxlength_time,
tr("&Max Record Time:"),this,
"lib_maxlength_label");
QLabel *lib_maxlength_label=
new QLabel(lib_maxlength_time,tr("&Max Record Time:"),this);
lib_maxlength_label->setGeometry(25,101,130,19);
lib_maxlength_label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);
//
// Autotrim Level
//
lib_threshold_spin=new QSpinBox(this,"lib_threshold_spin");
lib_threshold_spin=new QSpinBox(this);
lib_threshold_spin->setGeometry(160,124,50,19);
lib_threshold_spin->setMinValue(-99);
lib_threshold_spin->setMaxValue(0);
label=new QLabel(lib_threshold_spin,tr("&AutoTrim Threshold:"),this,
"lib_threshold_spin_label");
label=new QLabel(lib_threshold_spin,tr("&AutoTrim Threshold:"),this);
label->setGeometry(25,124,130,19);
label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);
label=new QLabel(tr("dbFS"),this,"lib_threshold_spin_unit");
label=new QLabel(tr("dbFS"),this);
label->setGeometry(215,124,120,19);
label->setAlignment(AlignLeft|AlignVCenter|ShowPrefix);
//
// Normalization Level
//
lib_normalization_spin=new QSpinBox(this,"lib_normalization_spin");
lib_normalization_spin=new QSpinBox(this);
lib_normalization_spin->setGeometry(160,148,50,19);
lib_normalization_spin->setMinValue(-99);
lib_normalization_spin->setMaxValue(0);
label=new QLabel(lib_normalization_spin,tr("&Normalization Level:"),
this,"lib_normalization_spin_label");
label=new QLabel(lib_normalization_spin,tr("&Normalization Level:"),this);
label->setGeometry(25,148,130,19);
label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);
label=new QLabel(tr("dbFS"),this,"lib_normalization_spin_unit");
label=new QLabel(tr("dbFS"),this);
label->setGeometry(215,148,120,19);
label->setAlignment(AlignLeft|AlignVCenter|ShowPrefix);
//
// Audio Margin
//
lib_preroll_spin=new QSpinBox(this,"lib_preroll_spin");
lib_preroll_spin=new QSpinBox(this);
lib_preroll_spin->setGeometry(160,172,60,19);
lib_preroll_spin->setMinValue(0);
lib_preroll_spin->setMaxValue(10000);
lib_preroll_spin->setLineStep(100);
QLabel *lib_preroll_spin_label=new QLabel(lib_preroll_spin,
tr("&Audio Margin:"),this,
"lib_preroll_spin_label");
QLabel *lib_preroll_spin_label=
new QLabel(lib_preroll_spin,tr("&Audio Margin:"),this);
lib_preroll_spin_label->setGeometry(25,172,130,19);
lib_preroll_spin_label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);
QLabel *lib_preroll_spin_unit=new QLabel(tr("milliseconds"),this,
"lib_preroll_spin_unit");
QLabel *lib_preroll_spin_unit=new QLabel(tr("milliseconds"),this);
lib_preroll_spin_unit->setGeometry(225,172,120,19);
lib_preroll_spin_unit->setAlignment(AlignLeft|AlignVCenter|ShowPrefix);
//
// Format
//
lib_format_box=new QComboBox(this,"lib_name_edit");
lib_format_box=new QComboBox(this);
lib_format_box->setGeometry(160,196,150,19);
connect(lib_format_box,SIGNAL(activated(int)),this,SLOT(formatData(int)));
QLabel *lib_format_label=new QLabel(lib_format_box,tr("&Format:"),this,
"lib_format_label");
QLabel *lib_format_label=new QLabel(lib_format_box,tr("&Format:"),this);
lib_format_label->setGeometry(25,196,130,19);
lib_format_label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);
//
// Bitrate
//
lib_bitrate_box=new QComboBox(this,"lib_name_edit");
lib_bitrate_box=new QComboBox(this);
lib_bitrate_box->setGeometry(160,220,130,19);
QLabel *lib_bitrate_label=new QLabel(lib_bitrate_box,tr("&Bitrate:"),this,
"lib_bitrate_label");
QLabel *lib_bitrate_label=new QLabel(lib_bitrate_box,tr("&Bitrate:"),this);
lib_bitrate_label->setGeometry(25,220,130,19);
lib_bitrate_label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);
@@ -186,26 +177,26 @@ EditRDLogedit::EditRDLogedit(RDStation *station,RDStation *cae_station,
QLabel *lib_enable_second_start_label=
new QLabel(lib_enable_second_start_box,tr("Enable &2nd Start Button:"),this);
lib_enable_second_start_label->setGeometry(10,244,145,19);
lib_enable_second_start_label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);
lib_enable_second_start_label->
setAlignment(AlignRight|AlignVCenter|ShowPrefix);
//
// Validator
//
QIntValidator *validator=new QIntValidator(this,"validator");
QIntValidator *validator=new QIntValidator(this);
validator->setRange(1,999999);
//
// Play Start Cart
//
lib_startcart_edit=new QLineEdit(this,"lib_name_edit");
lib_startcart_edit=new QLineEdit(this);
lib_startcart_edit->setGeometry(160,268,70,19);
lib_startcart_edit->setValidator(validator);
QLabel *lib_startcart_label=
new QLabel(lib_startcart_edit,tr("Play &Start Cart:"),this,
"lib_startcart_label");
new QLabel(lib_startcart_edit,tr("Play &Start Cart:"),this);
lib_startcart_label->setGeometry(25,268,130,19);
lib_startcart_label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);
QPushButton *button=new QPushButton(this,"start_select_button");
QPushButton *button=new QPushButton(this);
button->setGeometry(240,266,55,23);
button->setText(tr("Select"));
connect(button,SIGNAL(clicked()),this,SLOT(selectStartData()));
@@ -213,15 +204,14 @@ EditRDLogedit::EditRDLogedit(RDStation *station,RDStation *cae_station,
//
// Play End Cart
//
lib_endcart_edit=new QLineEdit(this,"lib_name_edit");
lib_endcart_edit=new QLineEdit(this);
lib_endcart_edit->setGeometry(160,292,70,19);
lib_endcart_edit->setValidator(validator);
QLabel *lib_endcart_label=
new QLabel(lib_endcart_edit,tr("Play &End Cart:"),this,
"lib_endcart_label");
new QLabel(lib_endcart_edit,tr("Play &End Cart:"),this);
lib_endcart_label->setGeometry(25,292,130,19);
lib_endcart_label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);
button=new QPushButton(this,"end_select_button");
button=new QPushButton(this);
button->setGeometry(240,290,55,23);
button->setText(tr("Select"));
connect(button,SIGNAL(clicked()),this,SLOT(selectEndData()));
@@ -229,15 +219,14 @@ EditRDLogedit::EditRDLogedit(RDStation *station,RDStation *cae_station,
//
// Record Start Cart
//
lib_recstartcart_edit=new QLineEdit(this,"lib_name_edit");
lib_recstartcart_edit=new QLineEdit(this);
lib_recstartcart_edit->setGeometry(160,316,70,19);
lib_recstartcart_edit->setValidator(validator);
QLabel *lib_recstartcart_label=
new QLabel(lib_recstartcart_edit,tr("&Record Start Cart:"),this,
"lib_recstartcart_label");
new QLabel(lib_recstartcart_edit,tr("&Record Start Cart:"),this);
lib_recstartcart_label->setGeometry(25,316,130,19);
lib_recstartcart_label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);
button=new QPushButton(this,"start_select_button");
button=new QPushButton(this);
button->setGeometry(240,314,55,23);
button->setText(tr("Select"));
connect(button,SIGNAL(clicked()),this,SLOT(selectRecordStartData()));
@@ -245,15 +234,14 @@ EditRDLogedit::EditRDLogedit(RDStation *station,RDStation *cae_station,
//
// Record End Cart
//
lib_recendcart_edit=new QLineEdit(this,"lib_name_edit");
lib_recendcart_edit=new QLineEdit(this);
lib_recendcart_edit->setGeometry(160,340,70,19);
lib_recendcart_edit->setValidator(validator);
QLabel *lib_recendcart_label=
new QLabel(lib_recendcart_edit,tr("Re&cord End Cart:"),this,
"lib_recendcart_label");
new QLabel(lib_recendcart_edit,tr("Re&cord End Cart:"),this);
lib_recendcart_label->setGeometry(25,340,130,19);
lib_recendcart_label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);
button=new QPushButton(this,"end_select_button");
button=new QPushButton(this);
button->setGeometry(240,338,55,23);
button->setText(tr("Select"));
connect(button,SIGNAL(clicked()),this,SLOT(selectRecordEndData()));
@@ -261,21 +249,19 @@ EditRDLogedit::EditRDLogedit(RDStation *station,RDStation *cae_station,
//
// Default Channels
//
lib_channels_box=new QComboBox(this,"lib_name_edit");
lib_channels_box=new QComboBox(this);
lib_channels_box->setGeometry(160,364,60,19);
QLabel *lib_channels_label=new QLabel(lib_channels_box,tr("&Channels:"),this,
"lib_channels_label");
QLabel *lib_channels_label=new QLabel(lib_channels_box,tr("&Channels:"),this);
lib_channels_label->setGeometry(25,364,130,19);
lib_channels_label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);
//
// Default Transition Type
//
lib_default_transtype_box=new QComboBox(this,"lib_name_edit");
lib_default_transtype_box=new QComboBox(this);
lib_default_transtype_box->setGeometry(160,388,100,19);
QLabel *lib_default_transtype_label=
new QLabel(lib_default_transtype_box,tr("Default Transition:"),
this,"lib_default_transtype_label");
new QLabel(lib_default_transtype_box,tr("Default Transition:"),this);
lib_default_transtype_label->setGeometry(20,388,130,19);
lib_default_transtype_label->
setAlignment(AlignRight|AlignVCenter|ShowPrefix);
@@ -286,7 +272,7 @@ EditRDLogedit::EditRDLogedit(RDStation *station,RDStation *cae_station,
//
// Ok Button
//
QPushButton *ok_button=new QPushButton(this,"ok_button");
QPushButton *ok_button=new QPushButton(this);
ok_button->setGeometry(sizeHint().width()-180,sizeHint().height()-60,80,50);
ok_button->setDefault(true);
ok_button->setFont(small_font);
@@ -296,7 +282,7 @@ EditRDLogedit::EditRDLogedit(RDStation *station,RDStation *cae_station,
//
// Cancel Button
//
QPushButton *cancel_button=new QPushButton(this,"cancel_button");
QPushButton *cancel_button=new QPushButton(this);
cancel_button->setGeometry(sizeHint().width()-90,sizeHint().height()-60,
80,50);
cancel_button->setFont(small_font);
@@ -343,12 +329,26 @@ EditRDLogedit::EditRDLogedit(RDStation *station,RDStation *cae_station,
}
lib_preroll_spin->setValue(lib_lib->tailPreroll());
lib_format_box->insertItem(tr("PCM16"));
lib_format_box->insertItem(tr("PCM24"));
lib_format_box->insertItem(tr("MPEG Layer 2"));
lib_format_box->setCurrentItem(lib_lib->format());
switch(lib_lib->format()) {
case 0: // PCM16
lib_format_box->setCurrentItem(0);
break;
case 1: // MPEG L2
lib_format_box->setCurrentItem(2);
break;
case 2: // PCM24
lib_format_box->setCurrentItem(1);
break;
}
lib_channels_box->insertItem("1");
lib_channels_box->insertItem("2");
lib_channels_box->setCurrentItem(lib_lib->defaultChannels()-1);
ShowBitRates(lib_lib->format(),lib_lib->bitrate());
ShowBitRates(lib_format_box->currentItem(),lib_lib->bitrate());
lib_enable_second_start_box->setCurrentItem(lib_lib->enableSecondStart());
lib_default_transtype_box->setCurrentItem(lib_lib->defaultTransType());
}
@@ -460,10 +460,22 @@ void EditRDLogedit::okData()
else {
lib_lib->setRecEndCart(lib_recendcart_edit->text().toUInt());
}
lib_lib->setFormat(lib_format_box->currentItem());
switch(lib_format_box->currentItem()) {
case 0: // PCM16
lib_lib->setFormat(0);
break;
case 1: // PCM24
lib_lib->setFormat(2);
break;
case 2: // MPEG L2
lib_lib->setFormat(1);
break;
}
lib_lib->setDefaultChannels(lib_channels_box->currentItem()+1);
rate=0;
if(lib_format_box->currentItem()!=0) {
if(lib_format_box->currentItem()==2) {
sscanf(lib_bitrate_box->currentText(),"%d",&rate);
}
lib_lib->setBitrate(rate*1000);
@@ -480,147 +492,72 @@ void EditRDLogedit::cancelData()
}
void EditRDLogedit::ShowBitRates(int layer,int rate)
void EditRDLogedit::ShowBitRates(int index,int rate)
{
lib_bitrate_box->clear();
switch(layer) {
case 0: // PCM16
lib_bitrate_box->setDisabled(true);
break;
switch(index) {
case 0: // PCM16
case 1: // PCM24
lib_bitrate_box->setDisabled(true);
break;
case 1: // MPEG-1 Layer 2
lib_bitrate_box->setEnabled(true);
lib_bitrate_box->insertItem(tr("32 kbps/chan"));
lib_bitrate_box->insertItem(tr("48 kbps/chan"));
lib_bitrate_box->insertItem(tr("56 kbps/chan"));
lib_bitrate_box->insertItem(tr("64 kbps/chan"));
lib_bitrate_box->insertItem(tr("80 kbps/chan"));
lib_bitrate_box->insertItem(tr("96 kbps/chan"));
lib_bitrate_box->insertItem(tr("112 kbps/chan"));
lib_bitrate_box->insertItem(tr("128 kbps/chan"));
lib_bitrate_box->insertItem(tr("160 kbps/chan"));
lib_bitrate_box->insertItem(tr("192 kbps/chan"));
switch(lib_lib->bitrate()) {
case 32000:
lib_bitrate_box->setCurrentItem(0);
break;
case 2: // MPEG-1 Layer 2
lib_bitrate_box->setEnabled(true);
lib_bitrate_box->insertItem(tr("32 kbps/chan"));
lib_bitrate_box->insertItem(tr("48 kbps/chan"));
lib_bitrate_box->insertItem(tr("56 kbps/chan"));
lib_bitrate_box->insertItem(tr("64 kbps/chan"));
lib_bitrate_box->insertItem(tr("80 kbps/chan"));
lib_bitrate_box->insertItem(tr("96 kbps/chan"));
lib_bitrate_box->insertItem(tr("112 kbps/chan"));
lib_bitrate_box->insertItem(tr("128 kbps/chan"));
lib_bitrate_box->insertItem(tr("160 kbps/chan"));
lib_bitrate_box->insertItem(tr("192 kbps/chan"));
switch(lib_lib->bitrate()) {
case 32000:
lib_bitrate_box->setCurrentItem(0);
break;
case 48000:
lib_bitrate_box->setCurrentItem(1);
break;
case 48000:
lib_bitrate_box->setCurrentItem(1);
break;
case 56000:
lib_bitrate_box->setCurrentItem(2);
break;
case 56000:
lib_bitrate_box->setCurrentItem(2);
break;
case 64000:
lib_bitrate_box->setCurrentItem(3);
break;
case 64000:
lib_bitrate_box->setCurrentItem(3);
break;
case 80000:
lib_bitrate_box->setCurrentItem(4);
break;
case 80000:
lib_bitrate_box->setCurrentItem(4);
break;
case 96000:
lib_bitrate_box->setCurrentItem(5);
break;
case 96000:
lib_bitrate_box->setCurrentItem(5);
break;
case 112000:
lib_bitrate_box->setCurrentItem(6);
break;
case 112000:
lib_bitrate_box->setCurrentItem(6);
break;
case 128000:
lib_bitrate_box->setCurrentItem(7);
break;
case 128000:
lib_bitrate_box->setCurrentItem(7);
break;
case 160000:
lib_bitrate_box->setCurrentItem(8);
break;
case 160000:
lib_bitrate_box->setCurrentItem(8);
break;
case 192000:
lib_bitrate_box->setCurrentItem(9);
break;
default:
lib_bitrate_box->setCurrentItem(7); // 128 kbps/chan
break;
}
break;
case 2: // MPEG-1 Layer 3
lib_bitrate_box->setEnabled(true);
lib_bitrate_box->insertItem(tr("32 kbps/chan"));
lib_bitrate_box->insertItem(tr("40 kbps/chan"));
lib_bitrate_box->insertItem(tr("48 kbps/chan"));
lib_bitrate_box->insertItem(tr("56 kbps/chan"));
lib_bitrate_box->insertItem(tr("64 kbps/chan"));
lib_bitrate_box->insertItem(tr("80 kbps/chan"));
lib_bitrate_box->insertItem(tr("96 kbps/chan"));
lib_bitrate_box->insertItem(tr("112 kbps/chan"));
lib_bitrate_box->insertItem(tr("128 kbps/chan"));
lib_bitrate_box->insertItem(tr("160 kbps/chan"));
lib_bitrate_box->insertItem(tr("192 kbps/chan"));
lib_bitrate_box->insertItem(tr("224 kbps/chan"));
lib_bitrate_box->insertItem(tr("256 kbps/chan"));
lib_bitrate_box->insertItem(tr("320 kbps/chan"));
switch(lib_lib->layer()) {
case 32000:
lib_bitrate_box->setCurrentItem(0);
break;
case 40000:
lib_bitrate_box->setCurrentItem(1);
break;
case 48000:
lib_bitrate_box->setCurrentItem(2);
break;
case 56000:
lib_bitrate_box->setCurrentItem(3);
break;
case 64000:
lib_bitrate_box->setCurrentItem(4);
break;
case 80000:
lib_bitrate_box->setCurrentItem(5);
break;
case 96000:
lib_bitrate_box->setCurrentItem(6);
break;
case 112000:
lib_bitrate_box->setCurrentItem(7);
break;
case 128000:
lib_bitrate_box->setCurrentItem(8);
break;
case 160000:
lib_bitrate_box->setCurrentItem(9);
break;
case 192000:
lib_bitrate_box->setCurrentItem(10);
break;
case 224000:
lib_bitrate_box->setCurrentItem(11);
break;
case 256000:
lib_bitrate_box->setCurrentItem(12);
break;
case 320000:
lib_bitrate_box->setCurrentItem(13);
break;
}
break;
case 192000:
lib_bitrate_box->setCurrentItem(9);
break;
default:
lib_bitrate_box->setCurrentItem(7); // 128 kbps/chan
break;
}
break;
}
}