ATV Modulator: transmit video full features

This commit is contained in:
f4exb 2017-03-10 00:30:15 +01:00
parent b6b972638a
commit dee348a2ad
5 changed files with 88 additions and 12 deletions

View File

@ -76,9 +76,18 @@ void ATVMod::configure(MessageQueue* messageQueue,
ATVModInput atvModInput,
Real uniformLevel,
ATVModulation atvModulation,
bool videoPlayLoop,
bool videoPlay,
bool channelMute)
{
Message* cmd = MsgConfigureATVMod::create(rfBandwidth, atvStd, atvModInput, uniformLevel, atvModulation);
Message* cmd = MsgConfigureATVMod::create(
rfBandwidth,
atvStd,
atvModInput,
uniformLevel,
atvModulation,
videoPlayLoop,
videoPlay);
messageQueue->push(cmd);
}
@ -185,7 +194,7 @@ void ATVMod::pullVideo(Real& sample)
m_lineCount = 0;
m_evenImage = !m_evenImage;
if ((m_running.m_atvModInput == ATVModInputVideo) && m_videoOK)
if ((m_running.m_atvModInput == ATVModInputVideo) && m_videoOK && (m_running.m_videoPlay))
{
int grabOK;
int fpsIncrement = (int) m_videoFPSCount - m_videoPrevFPSCount;
@ -212,7 +221,10 @@ void ATVMod::pullVideo(Real& sample)
}
else
{
// TODO: handle play loop
if (m_running.m_videoPlayLoop) // play loop
{
seekVideoFileStream(0);
}
}
if (m_videoFPSCount < m_videoFPS)
@ -287,6 +299,8 @@ bool ATVMod::handleMessage(const Message& cmd)
m_config.m_atvStd = cfg.getATVStd();
m_config.m_uniformLevel = cfg.getUniformLevel();
m_config.m_atvModulation = cfg.getModulation();
m_config.m_videoPlayLoop = cfg.getVideoPlayLoop();
m_config.m_videoPlay = cfg.getVideoPlay();
apply();
@ -295,7 +309,9 @@ bool ATVMod::handleMessage(const Message& cmd)
<< " m_atvStd: " << (int) m_config.m_atvStd
<< " m_atvModInput: " << (int) m_config.m_atvModInput
<< " m_uniformLevel: " << m_config.m_uniformLevel
<< " m_atvModulation: " << (int) m_config.m_atvModulation;
<< " m_atvModulation: " << (int) m_config.m_atvModulation
<< " m_videoPlayLoop: " << m_config.m_videoPlayLoop
<< " m_videoPlay: " << m_config.m_videoPlay;
return true;
}
@ -382,6 +398,8 @@ void ATVMod::apply(bool force)
m_running.m_atvStd = m_config.m_atvStd;
m_running.m_uniformLevel = m_config.m_uniformLevel;
m_running.m_atvModulation = m_config.m_atvModulation;
m_running.m_videoPlayLoop = m_config.m_videoPlayLoop;
m_running.m_videoPlay = m_config.m_videoPlay;
}
int ATVMod::getSampleRateUnits(ATVStd std)

View File

@ -194,6 +194,8 @@ public:
ATVModInput atvModInput,
Real uniformLevel,
ATVModulation atvModulation,
bool videoPlayLoop,
bool videoPlay,
bool channelMute);
virtual void pull(Sample& sample);
@ -226,15 +228,26 @@ private:
ATVModInput getATVModInput() const { return m_atvModInput; }
Real getUniformLevel() const { return m_uniformLevel; }
ATVModulation getModulation() const { return m_atvModulation; }
bool getVideoPlayLoop() const { return m_videoPlayLoop; }
bool getVideoPlay() const { return m_videoPlay; }
static MsgConfigureATVMod* create(
Real rfBandwidth,
ATVStd atvStd,
ATVModInput atvModInput,
Real uniformLevel,
ATVModulation atvModulation)
ATVModulation atvModulation,
bool videoPlayLoop,
bool videoPlay)
{
return new MsgConfigureATVMod(rfBandwidth, atvStd, atvModInput, uniformLevel, atvModulation);
return new MsgConfigureATVMod(
rfBandwidth,
atvStd,
atvModInput,
uniformLevel,
atvModulation,
videoPlayLoop,
videoPlay);
}
private:
@ -243,19 +256,25 @@ private:
ATVModInput m_atvModInput;
Real m_uniformLevel;
ATVModulation m_atvModulation;
bool m_videoPlayLoop;
bool m_videoPlay;
MsgConfigureATVMod(
Real rfBandwidth,
ATVStd atvStd,
ATVModInput atvModInput,
Real uniformLevel,
ATVModulation atvModulation) :
ATVModulation atvModulation,
bool videoPlayLoop,
bool videoPlay) :
Message(),
m_rfBandwidth(rfBandwidth),
m_atvStd(atvStd),
m_atvModInput(atvModInput),
m_uniformLevel(uniformLevel),
m_atvModulation(atvModulation)
m_atvModulation(atvModulation),
m_videoPlayLoop(videoPlayLoop),
m_videoPlay(videoPlay)
{ }
};
@ -268,6 +287,8 @@ private:
ATVModInput m_atvModInput; //!< Input source type
Real m_uniformLevel; //!< Percentage between black and white for uniform screen display
ATVModulation m_atvModulation; //!< RF modulation type
bool m_videoPlayLoop; //!< Play video in a loop
bool m_videoPlay; //!< True to play video and false to pause
Config() :
m_outputSampleRate(-1),
@ -276,7 +297,9 @@ private:
m_atvStd(ATVStdPAL625),
m_atvModInput(ATVModInputHBars),
m_uniformLevel(0.5f),
m_atvModulation(ATVModulationAM)
m_atvModulation(ATVModulationAM),
m_videoPlayLoop(false),
m_videoPlay(false)
{ }
};

View File

@ -270,6 +270,29 @@ void ATVModGUI::on_videoFileDialog_clicked(bool checked)
}
}
void ATVModGUI::on_playLoop_toggled(bool checked)
{
applySettings();
}
void ATVModGUI::on_play_toggled(bool checked)
{
ui->navTimeSlider->setEnabled(!checked);
m_enableNavTime = !checked;
applySettings();
}
void ATVModGUI::on_navTimeSlider_valueChanged(int value)
{
if (m_enableNavTime && ((value >= 0) && (value <= 100)))
{
int seekFame = (m_videoLength * value) / 100;
ATVMod::MsgConfigureVideoFileSourceSeek* message = ATVMod::MsgConfigureVideoFileSourceSeek::create(value);
m_atvMod->getInputMessageQueue()->push(message);
}
}
void ATVModGUI::configureImageFileName()
{
qDebug() << "ATVModGUI::configureImageFileName: " << m_imageFileName.toStdString().c_str();
@ -380,6 +403,8 @@ void ATVModGUI::applySettings()
(ATVMod::ATVModInput) ui->inputSelect->currentIndex(),
ui->uniformLevel->value() / 100.0f,
(ATVMod::ATVModulation) ui->modulation->currentIndex(),
ui->playLoop->isChecked(),
ui->play->isChecked(),
ui->channelMute->isChecked());
}
}

View File

@ -69,6 +69,10 @@ private slots:
void on_imageFileDialog_clicked(bool checked);
void on_videoFileDialog_clicked(bool checked);
void on_play_toggled(bool checked);
void on_playLoop_toggled(bool checked);
void on_navTimeSlider_valueChanged(int value);
void onWidgetRolled(QWidget* widget, bool rollDown);
void onMenuDoubleClicked();

View File

@ -169,7 +169,7 @@
<item>
<widget class="QToolButton" name="channelMute">
<property name="toolTip">
<string>Mute/Unmute channel</string>
<string>Mute/Unmute channel (not implemented)</string>
</property>
<property name="text">
<string>...</string>
@ -223,7 +223,7 @@
<item>
<widget class="QSlider" name="rfBW">
<property name="toolTip">
<string>Demodulator (RF) bandwidth</string>
<string>Modulator (RF) bandwidth when interpolation takes place</string>
</property>
<property name="minimum">
<number>1</number>
@ -285,7 +285,7 @@
</size>
</property>
<property name="toolTip">
<string>Audio input gain</string>
<string>Video input gain (not implemented)</string>
</property>
<property name="maximum">
<number>20</number>
@ -346,6 +346,9 @@
<layout class="QHBoxLayout" name="recordFileSelectLayout">
<item>
<widget class="QComboBox" name="standard">
<property name="toolTip">
<string>TV standard</string>
</property>
<item>
<property name="text">
<string>PAL625L</string>
@ -355,6 +358,9 @@
</item>
<item>
<widget class="QComboBox" name="inputSelect">
<property name="toolTip">
<string>Video pattern or input source</string>
</property>
<item>
<property name="text">
<string>Uniform</string>