1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-23 00:18:37 -05:00

ATV Modulator: added image file dialog

This commit is contained in:
f4exb 2017-03-08 01:35:18 +01:00
parent 5e8f17ba8c
commit 806b955110
9 changed files with 95 additions and 6 deletions

View File

@ -20,6 +20,7 @@
#include "atvmod.h" #include "atvmod.h"
MESSAGE_CLASS_DEFINITION(ATVMod::MsgConfigureATVMod, Message) MESSAGE_CLASS_DEFINITION(ATVMod::MsgConfigureATVMod, Message)
MESSAGE_CLASS_DEFINITION(ATVMod::MsgConfigureImageFileName, Message)
const float ATVMod::m_blackLevel = 0.3f; const float ATVMod::m_blackLevel = 0.3f;
const float ATVMod::m_spanLevel = 0.7f; const float ATVMod::m_spanLevel = 0.7f;
@ -242,6 +243,13 @@ bool ATVMod::handleMessage(const Message& cmd)
return true; return true;
} }
else if (MsgConfigureImageFileName::match(cmd))
{
MsgConfigureImageFileName& conf = (MsgConfigureImageFileName&) cmd;
// m_fileName = conf.getFileName(); // TODO
// openFileStream();
return true;
}
else else
{ {
return false; return false;

View File

@ -45,7 +45,9 @@ public:
ATVModInputVBars, ATVModInputVBars,
ATVModInputCheckbox, ATVModInputCheckbox,
ATVModInputHGradient, ATVModInputHGradient,
ATVModInputVGradient ATVModInputVGradient,
ATVModInputImage,
ATVModInputVideo
} ATVModInput; } ATVModInput;
typedef enum typedef enum
@ -54,6 +56,27 @@ public:
ATVModulationFM ATVModulationFM
} ATVModulation; } 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();
~ATVMod(); ~ATVMod();

View File

@ -227,6 +227,26 @@ void ATVModGUI::on_channelMute_toggled(bool checked)
applySettings(); 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) void ATVModGUI::onWidgetRolled(QWidget* widget, bool rollDown)
{ {
} }

View File

@ -66,10 +66,12 @@ private slots:
void on_inputSelect_currentIndexChanged(int index); void on_inputSelect_currentIndexChanged(int index);
void on_volume_valueChanged(int value); void on_volume_valueChanged(int value);
void on_channelMute_toggled(bool checked); void on_channelMute_toggled(bool checked);
void on_imageFileDialog_clicked(bool checked);
void onWidgetRolled(QWidget* widget, bool rollDown); void onWidgetRolled(QWidget* widget, bool rollDown);
void onMenuDoubleClicked(); void onMenuDoubleClicked();
void configureImageFileName();
void tick(); void tick();
private: private:
@ -85,7 +87,7 @@ private:
ATVMod* m_atvMod; ATVMod* m_atvMod;
MovingAverage<Real> m_channelPowerDbAvg; MovingAverage<Real> m_channelPowerDbAvg;
QString m_fileName; QString m_imageFileName;
quint32 m_recordLength; quint32 m_recordLength;
int m_recordSampleRate; int m_recordSampleRate;
int m_samplesCount; int m_samplesCount;

View File

@ -372,7 +372,7 @@
</item> </item>
<item> <item>
<property name="text"> <property name="text">
<string>Chekbox</string> <string>Chekbd</string>
</property> </property>
</item> </item>
<item> <item>
@ -474,7 +474,7 @@
<item> <item>
<layout class="QHBoxLayout" name="playControllLayout"> <layout class="QHBoxLayout" name="playControllLayout">
<item> <item>
<widget class="QPushButton" name="showFileDialog"> <widget class="QPushButton" name="imageFileDialog">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>24</width> <width>24</width>
@ -488,14 +488,47 @@
</size> </size>
</property> </property>
<property name="toolTip"> <property name="toolTip">
<string>Open record file (48 kHz 32 bit float LE mono)</string> <string>Open still image file</string>
</property> </property>
<property name="text"> <property name="text">
<string/> <string/>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../../../sdrbase/resources/res.qrc"> <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> </property>
</widget> </widget>
</item> </item>

BIN
sdrbase/resources/film.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 378 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 888 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 408 B

View File

@ -71,5 +71,8 @@
<file>txon.png</file> <file>txon.png</file>
<file>arrow_down.png</file> <file>arrow_down.png</file>
<file>arrow_up.png</file> <file>arrow_up.png</file>
<file>film_reel.png</file>
<file>film.png</file>
<file>picture.png</file>
</qresource> </qresource>
</RCC> </RCC>