diff --git a/libxsync b/libxsync index 76e2707..f0e204c 160000 --- a/libxsync +++ b/libxsync @@ -1 +1 @@ -Subproject commit 76e2707f5c6bd1297e135f41e55ade20f456678c +Subproject commit f0e204cec62237684d61dab803498d6403966a9b diff --git a/mainwindow.cpp b/mainwindow.cpp index f15cdba..8cc1fb3 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -281,6 +281,28 @@ void MainWindow::UI_SigGeneratorConstruct() { } } +void MainWindow::UI_TimecodeOutputModuleConstruct() { + ui->TimecodeOutputModule_TimecodeSrcSelect->clear(); + for (auto &str : timecode_output_module::TriggerSigTypeStrSet()) { + ui->TimecodeOutputModule_TimecodeSrcSelect->addItem(QString::fromStdString(str)); + } + + ui->TimecodeOutputModule_BncOutputLevel->clear(); + for (auto &str : timecode_output_module::OutputSigLevelTypeStrSet()) { + ui->TimecodeOutputModule_BncOutputLevel->addItem(QString::fromStdString(str)); + } + + ui->TimecodeOutputModule_HeadphoneOutputLevel->clear(); + for (auto &str : timecode_output_module::OutputSigLevelTypeStrSet()) { + ui->TimecodeOutputModule_HeadphoneOutputLevel->addItem(QString::fromStdString(str)); + } + + ui->TimecodeOutputModule_TimecodeFormat->clear(); + for (auto &str : TimecodeFormatStrSet()) { + ui->TimecodeOutputModule_TimecodeFormat->addItem(QString::fromStdString(str)); + } +} + MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); m_mainWindow = this; @@ -292,6 +314,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi qInstallMessageHandler(log_output); UI_TTLOutputMoudleConstruct(); UI_SigGeneratorConstruct(); + UI_TimecodeOutputModuleConstruct(); /******************************************************************************* * 连接信号与槽 * @@ -492,9 +515,40 @@ void MainWindow::on_SigGenerator_Update_clicked() { DO_XSYNC_FUNC(Xsync::Ins().SigGenerator_setTimecode(timecode)); DO_XSYNC_FUNC(Xsync::Ins().SigGenerator_setAutoStartTimecode(autoStartTimecode)); } -void MainWindow::on_SigGenerator_Start_clicked() { - DO_XSYNC_FUNC(Xsync::Ins().SigGenerator_manualStart()); +void MainWindow::on_SigGenerator_Start_clicked() { DO_XSYNC_FUNC(Xsync::Ins().SigGenerator_manualStart()); } +void MainWindow::on_SigGenerator_Stop_clicked() { DO_XSYNC_FUNC(Xsync::Ins().SigGenerator_manualStop()); } + +void MainWindow::on_TimecodeOutputModule_Read_clicked() { + // TimecodeOutputModule_TimecodeSrcSelect + // TimecodeOutputModule_BncOutputLevel + // TimecodeOutputModule_HeadphoneOutputLevel + // TimecodeOutputModule_TimecodeFormat + // TimecodeOutputModule_TimecodeNow + + timecode_output_module::TriggerSigType_t TimecodeSrcSelect; + timecode_output_module::OutputSigLevelType_t BncOutputLevel; + timecode_output_module::OutputSigLevelType_t HeadphoneOutputLevel; + TimecodeFormat_t TimecodeFormat; + XsyncTimecode_t TimecodeNow; + + DO_XSYNC_FUNC(Xsync::Ins().TimecodeOutputModule_getTimecodeSrcSelect(TimecodeSrcSelect)); + DO_XSYNC_FUNC(Xsync::Ins().TimecodeOutputModule_getBncOutputLevel(BncOutputLevel)); + DO_XSYNC_FUNC(Xsync::Ins().TimecodeOutputModule_getHeadphoneOutputLevel(HeadphoneOutputLevel)); + DO_XSYNC_FUNC(Xsync::Ins().TimecodeOutputModule_getTimecodeFormat(TimecodeFormat)); + DO_XSYNC_FUNC(Xsync::Ins().TimecodeOutputModule_getTimecodeNow(TimecodeNow)); + + ui->TimecodeOutputModule_TimecodeSrcSelect->setCurrentText(QString::fromStdString(timecode_output_module::TriggerSigType2Str(TimecodeSrcSelect))); + ui->TimecodeOutputModule_BncOutputLevel->setCurrentText(QString::fromStdString(timecode_output_module::OutputSigLevelType2Str(BncOutputLevel))); + ui->TimecodeOutputModule_HeadphoneOutputLevel->setCurrentText(QString::fromStdString(timecode_output_module::OutputSigLevelType2Str(HeadphoneOutputLevel))); + ui->TimecodeOutputModule_TimecodeFormat->setCurrentText(QString::fromStdString(TimecodeFormatToStr(TimecodeFormat))); + ui->TimecodeOutputModule_TimecodeNow->setText(QString(XsyncTimecodeToStr(TimecodeNow).c_str())); } -void MainWindow::on_SigGenerator_Stop_clicked() { - DO_XSYNC_FUNC(Xsync::Ins().SigGenerator_manualStop()); +void MainWindow::on_TimecodeOutputModule_Update_clicked() { + auto TimecodeSrcSelect = timecode_output_module::Str2TriggerSigType(ui->TimecodeOutputModule_TimecodeSrcSelect->currentText().toStdString()); + auto BncOutputLevel = timecode_output_module::Str2OutputSigLevelType(ui->TimecodeOutputModule_BncOutputLevel->currentText().toStdString()); + auto HeadphoneOutputLevel = timecode_output_module::Str2OutputSigLevelType(ui->TimecodeOutputModule_HeadphoneOutputLevel->currentText().toStdString()); + + DO_XSYNC_FUNC(Xsync::Ins().TimecodeOutputModule_setTimecodeSrcSelect(TimecodeSrcSelect)); + DO_XSYNC_FUNC(Xsync::Ins().TimecodeOutputModule_setBncOutputLevel(BncOutputLevel)); + DO_XSYNC_FUNC(Xsync::Ins().TimecodeOutputModule_setHeadphoneOutputLevel(HeadphoneOutputLevel)); } \ No newline at end of file diff --git a/mainwindow.h b/mainwindow.h index f2fb316..59e899c 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -107,6 +107,9 @@ class MainWindow : public QMainWindow { void on_SigGenerator_Start_clicked(); void on_SigGenerator_Stop_clicked(); + void on_TimecodeOutputModule_Read_clicked(); + void on_TimecodeOutputModule_Update_clicked(); + signals: void append_log_signal(QString str); void updateUI_timeCodeInfo_signal(QString); @@ -120,5 +123,6 @@ class MainWindow : public QMainWindow { void UI_TTLOutputMoudleConstruct(); void UI_SigGeneratorConstruct(); + void UI_TimecodeOutputModuleConstruct(); }; #endif // MAINWINDOW_H diff --git a/mainwindow.ui b/mainwindow.ui index da008a1..12e9c20 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -102,7 +102,7 @@ - 3 + 4 @@ -385,84 +385,6 @@ false - - - - 490 - 20 - 131 - 31 - - - - SetGenlockFormat - - - - - - 490 - 60 - 131 - 31 - - - - GetGenlockFormat - - - - - - 490 - 100 - 131 - 31 - - - - SetTimecodeFormat - - - - - - 490 - 140 - 131 - 31 - - - - GetTimecodeFormat - - - - - - 630 - 40 - 241 - 31 - - - - -1 - - - - - - 630 - 110 - 241 - 31 - - - - -1 - - @@ -855,6 +777,167 @@ + + + TIMECODE输出模块 + + + + + 30 + 210 + 151 + 31 + + + + TimecodeFormat + + + + + + 30 + 60 + 101 + 31 + + + + TriggerSigType + + + + + + 500 + 110 + 151 + 41 + + + + Update + + + + + + 30 + 110 + 101 + 31 + + + + BncOutLevel + + + + + + 30 + 160 + 161 + 31 + + + + HeadphoneOutLevel + + + + + + 500 + 60 + 151 + 41 + + + + Read + + + + + + 220 + 60 + 241 + 31 + + + + -1 + + + + + + 220 + 110 + 241 + 31 + + + + + + + 220 + 160 + 241 + 31 + + + + + + + 220 + 210 + 241 + 31 + + + + + + + 30 + 260 + 151 + 31 + + + + Timecode + + + + + + 220 + 260 + 241 + 31 + + + + + 75 + true + + + + + + + false + + +