mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-26 09:48:45 -05:00
ATV Modulator: added image file dialog
This commit is contained in:
parent
5e8f17ba8c
commit
806b955110
@ -20,6 +20,7 @@
|
||||
#include "atvmod.h"
|
||||
|
||||
MESSAGE_CLASS_DEFINITION(ATVMod::MsgConfigureATVMod, Message)
|
||||
MESSAGE_CLASS_DEFINITION(ATVMod::MsgConfigureImageFileName, Message)
|
||||
|
||||
const float ATVMod::m_blackLevel = 0.3f;
|
||||
const float ATVMod::m_spanLevel = 0.7f;
|
||||
@ -242,6 +243,13 @@ bool ATVMod::handleMessage(const Message& cmd)
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (MsgConfigureImageFileName::match(cmd))
|
||||
{
|
||||
MsgConfigureImageFileName& conf = (MsgConfigureImageFileName&) cmd;
|
||||
// m_fileName = conf.getFileName(); // TODO
|
||||
// openFileStream();
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
|
@ -45,7 +45,9 @@ public:
|
||||
ATVModInputVBars,
|
||||
ATVModInputCheckbox,
|
||||
ATVModInputHGradient,
|
||||
ATVModInputVGradient
|
||||
ATVModInputVGradient,
|
||||
ATVModInputImage,
|
||||
ATVModInputVideo
|
||||
} ATVModInput;
|
||||
|
||||
typedef enum
|
||||
@ -54,6 +56,27 @@ public:
|
||||
ATVModulationFM
|
||||
} ATVModulation;
|
||||
|
||||
class MsgConfigureImageFileName : public Message
|
||||
{
|
||||
MESSAGE_CLASS_DECLARATION
|
||||
|
||||
public:
|
||||
const QString& getFileName() const { return m_fileName; }
|
||||
|
||||
static MsgConfigureImageFileName* create(const QString& fileName)
|
||||
{
|
||||
return new MsgConfigureImageFileName(fileName);
|
||||
}
|
||||
|
||||
private:
|
||||
QString m_fileName;
|
||||
|
||||
MsgConfigureImageFileName(const QString& fileName) :
|
||||
Message(),
|
||||
m_fileName(fileName)
|
||||
{ }
|
||||
};
|
||||
|
||||
ATVMod();
|
||||
~ATVMod();
|
||||
|
||||
|
@ -227,6 +227,26 @@ void ATVModGUI::on_channelMute_toggled(bool checked)
|
||||
applySettings();
|
||||
}
|
||||
|
||||
void ATVModGUI::on_imageFileDialog_clicked(bool checked)
|
||||
{
|
||||
QString fileName = QFileDialog::getOpenFileName(this,
|
||||
tr("Open image file"), ".", tr("Image Files (*.png *.jpg *.bmp)"));
|
||||
|
||||
if (fileName != "")
|
||||
{
|
||||
m_imageFileName = fileName;
|
||||
ui->recordFileText->setText(m_imageFileName);
|
||||
configureImageFileName();
|
||||
}
|
||||
}
|
||||
|
||||
void ATVModGUI::configureImageFileName()
|
||||
{
|
||||
qDebug() << "ATVModGUI::configureImageFileName: " << m_imageFileName.toStdString().c_str();
|
||||
ATVMod::MsgConfigureImageFileName* message = ATVMod::MsgConfigureImageFileName::create(m_imageFileName);
|
||||
m_atvMod->getInputMessageQueue()->push(message);
|
||||
}
|
||||
|
||||
void ATVModGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
{
|
||||
}
|
||||
|
@ -66,10 +66,12 @@ private slots:
|
||||
void on_inputSelect_currentIndexChanged(int index);
|
||||
void on_volume_valueChanged(int value);
|
||||
void on_channelMute_toggled(bool checked);
|
||||
void on_imageFileDialog_clicked(bool checked);
|
||||
|
||||
void onWidgetRolled(QWidget* widget, bool rollDown);
|
||||
void onMenuDoubleClicked();
|
||||
|
||||
void configureImageFileName();
|
||||
void tick();
|
||||
|
||||
private:
|
||||
@ -85,7 +87,7 @@ private:
|
||||
ATVMod* m_atvMod;
|
||||
MovingAverage<Real> m_channelPowerDbAvg;
|
||||
|
||||
QString m_fileName;
|
||||
QString m_imageFileName;
|
||||
quint32 m_recordLength;
|
||||
int m_recordSampleRate;
|
||||
int m_samplesCount;
|
||||
|
@ -372,7 +372,7 @@
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Chekbox</string>
|
||||
<string>Chekbd</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
@ -474,7 +474,7 @@
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="playControllLayout">
|
||||
<item>
|
||||
<widget class="QPushButton" name="showFileDialog">
|
||||
<widget class="QPushButton" name="imageFileDialog">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
@ -488,14 +488,47 @@
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Open record file (48 kHz 32 bit float LE mono)</string>
|
||||
<string>Open still image file</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../sdrbase/resources/res.qrc">
|
||||
<normaloff>:/preset-load.png</normaloff>:/preset-load.png</iconset>
|
||||
<normaloff>:/picture.png</normaloff>:/picture.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line_5">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="videoFileDialog">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Open video file</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../sdrbase/resources/res.qrc">
|
||||
<normaloff>:/film_reel.png</normaloff>:/film_reel.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
BIN
sdrbase/resources/film.png
Normal file
BIN
sdrbase/resources/film.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 378 B |
BIN
sdrbase/resources/film_reel.png
Normal file
BIN
sdrbase/resources/film_reel.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 888 B |
BIN
sdrbase/resources/picture.png
Normal file
BIN
sdrbase/resources/picture.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 408 B |
@ -71,5 +71,8 @@
|
||||
<file>txon.png</file>
|
||||
<file>arrow_down.png</file>
|
||||
<file>arrow_up.png</file>
|
||||
<file>film_reel.png</file>
|
||||
<file>film.png</file>
|
||||
<file>picture.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
Loading…
Reference in New Issue
Block a user