37#include "libmythbase/mythconfig.h"
61 if (mod.endsWith(
"vsb"))
62 return mod.left(mod.length() - 3) +
"-VSB";
64 if (mod.startsWith(
"qam_"))
65 return "QAM-" + mod.mid(4, mod.length());
68 return QObject::tr(
"Analog");
75 std::vector<uint> cardids;
80 "SELECT capturecard.cardid "
82 "WHERE capturecard.sourceid = :SOURCEID AND "
83 " capturecard.parentid = 0 AND "
84 " capturecard.hostname = :HOSTNAME");
94 cardids.push_back(query.
value(0).toUInt());
99 "Sorry, the Transport Editor can only edit transports "
100 "of a video source that is connected to a capture card."));
105 std::vector<CardUtil::INPUT_TYPES> cardtypes;
107 for (
uint cardid : cardids)
111 if (cardtype ==
"DVB")
136 "Failed to probe a capture card connected to this "
137 "transport's video source. Please make sure the "
138 "backend is not running."));
143 cardtypes.push_back(nType);
147 if (cardtypes.empty())
152 for (
size_t i = 1; i < cardtypes.size(); i++)
172 "The capture cards connected to this transport's video source "
173 "are incompatible. Please create separate video sources "
174 "per capture card type."));
181 for (
size_t i = 1; i < cardtypes.size(); i++)
190 retval = cardtypes[i];
199 for (
auto *setting : std::as_const(
m_list))
255 "SELECT mplexid, modulation, frequency, "
256 " symbolrate, networkid, transportid, "
257 " constellation, mod_sys "
258 "FROM dtv_multiplex, videosource "
259 "WHERE dtv_multiplex.sourceid = :SOURCEID AND "
260 " dtv_multiplex.sourceid = videosource.sourceid "
261 "ORDER by networkid, transportid, frequency, mplexid");
275 query.
value(6).toString() : query.
value(1).toString();
278 while (mod.length() < 7)
281 QString rate = query.
value(3).toString();
282 rate = (rate ==
"0") ?
"" : QString(
"rate %1").arg(rate);
284 QString netid = query.
value(4).toUInt() ?
285 QString(
"netid %1").arg(query.
value(4).toUInt(), 5) :
"";
287 QString tid = query.
value(5).toUInt() ?
288 QString(
"tid %1").arg(query.
value(5).toUInt(), 5) :
"";
299 type = QString(
"(%1)").arg(query.
value(7).toString());
307 QString txt = QString(
"%1 %2 %3 %4 %5 %6 %7")
308 .arg(mod, query.
value(2).toString(),
309 hz, rate, netid, tid,
type);
314 this, [transport,
this] () {
Delete(transport); });
316 this, [transport,
this] () {
Menu(transport); });
318 m_list.push_back(transport);
331 m_list.push_back(transport);
342 tr(
"Are you sure you would like to delete this transport?"),
344 [transport,
this](
bool result)
352 query.
prepare(
"DELETE FROM dtv_multiplex WHERE mplexid = :MPLEXID");
358 query.
prepare(
"UPDATE channel SET deleted = NOW() "
359 "WHERE deleted IS NULL AND mplexid = :MPLEXID");
366 m_list.removeAll(transport);
376 auto *
menu =
new MythMenu(tr(
"Transport Menu"),
this,
"transportmenu");
377 menu->AddItem(tr(
"Delete..."), [transport,
this] () {
Delete(transport); });
382 menuPopup->SetReturnEvent(
this,
"transportmenu");
384 if (menuPopup->Create())
446 bool is_atsc_country) :
449 setLabel(QObject::tr(
"Digital TV Standard"));
451 "Guiding standard to use for making sense of the "
452 "data streams after they have been demodulated, "
453 "error corrected and demultiplexed."));
473 QString hz = (in_kHz) ?
"kHz" :
"Hz";
474 setLabel(QObject::tr(
"Frequency") +
" (" + hz +
")");
476 "Frequency (Option has no default).\n"
477 "The frequency for this transport (multiplex) in") +
" " + hz +
".");
487 setLabel(QObject::tr(
"Symbol Rate"));
490 "Symbol Rate (symbols/sec).\n"
491 "Most DVB-S transponders transmit at 27.5 "
492 "million symbols per second."));
512 setLabel(QObject::tr(
"Symbol Rate"));
515 "Symbol Rate (symbols/second).\n"
516 "Most DVB-C transports transmit at 6.9 or 6.875 "
517 "million symbols per second."));
534 setHelpText(QObject::tr(
"Polarity (Option has no default)"));
551 (
CardUtil::INPUT_TYPES::DVBT2 == nType)) ?
552 "constellation" :
"modulation")
554 setLabel(QObject::tr(
"Modulation"));
555 setHelpText(QObject::tr(
"Modulation, aka Constellation"));
607 setHelpText(QObject::tr(
"Inversion (Default: Auto):\n"
608 "Most cards can autodetect this now, so leave it at Auto"
609 " unless it won't work."));
623 setHelpText(QObject::tr(
"Bandwidth (Default: Auto)"));
638 setHelpText(QObject::tr(
"Bandwidth for DVB-T2 (Default: Auto)"));
679 setHelpText(QObject::tr(
"Forward Error Correction (Default: Auto)"));
691 setLabel(QObject::tr(
"LP Coderate"));
692 setHelpText(QObject::tr(
"Low Priority Code Rate (Default: Auto)"));
704 setLabel(QObject::tr(
"HP Coderate"));
705 setHelpText(QObject::tr(
"High Priority Code Rate (Default: Auto)"));
715 setLabel(QObject::tr(
"Guard Interval"));
716 setHelpText(QObject::tr(
"Guard Interval for DVB-T (Default: Auto)"));
731 setLabel(QObject::tr(
"Guard Interval"));
732 setHelpText(QObject::tr(
"Guard Interval for DVB-T2 (Default: Auto)"));
750 setLabel(QObject::tr(
"Transmission Mode"));
751 setHelpText(QObject::tr(
"Transmission Mode for DVB-T (Default: Auto)"));
767 setLabel(QObject::tr(
"Transmission Mode"));
768 setHelpText(QObject::tr(
"Transmission Mode for DVB-T2 (Default: Auto)"));
786 setHelpText(QObject::tr(
"Hierarchy (Default: Auto)"));
801 setLabel(QObject::tr(
"Modulation System"));
802 setHelpText(QObject::tr(
"Modulation System (Default: DVB-T2)"));
814 setLabel(QObject::tr(
"Modulation System"));
815 setHelpText(QObject::tr(
"Modulation System (Default: DVB-S2)"));
827 setLabel(QObject::tr(
"Modulation System"));
828 setHelpText(QObject::tr(
"Modulation System (Default: DVB-C/A)"));
842 setHelpText(QObject::tr(
"Roll-off factor (Default: 0.35)"));
941 for (
int i = 0; i < actions.size() && !handled; i++)
943 const QString&
action = actions[i];
950 else if (
action ==
"MENU")
Collection of helper utilities for input DB use.
static INPUT_TYPES toInputType(const QString &name)
static QString GetRawInputType(uint inputid)
static bool HDHRdoesDVB(const QString &device)
If the device is valid, check if the model does DVB.
INPUT_TYPES
all the different inputs
static QString GetVideoDevice(uint inputid)
static bool HDHRdoesDVBC(const QString &device)
If the device is valid, check if the model does DVB-C.
static QString ProbeSubTypeName(uint inputid)
QString GetColumnName(void) const
DTVStandard(const MultiplexID *id, bool is_dvb_country, bool is_atsc_country)
DVBCModulationSystem(const MultiplexID *id)
DVBCSymbolRate(const MultiplexID *id)
DVBForwardErrorCorrectionSelector(Storage *_storage)
DVBForwardErrorCorrection(const MultiplexID *id)
DVBInversion(const MultiplexID *id)
DVBSModulationSystem(const MultiplexID *id)
DVBSSymbolRate(const MultiplexID *id)
DVBT2Bandwidth(const MultiplexID *id)
DVBT2GuardInterval(const MultiplexID *id)
DVBT2TransmissionMode(const MultiplexID *id)
DVBTBandwidth(const MultiplexID *id)
DVBTCoderateHP(const MultiplexID *id)
DVBTCoderateLP(const MultiplexID *id)
DVBTGuardInterval(const MultiplexID *id)
DVBTHierarchy(const MultiplexID *id)
DVBTModulationSystem(const MultiplexID *id)
DVBTTransmissionMode(const MultiplexID *id)
Event dispatched from MythUI modal dialogs to a listening class containing a result of some form.
Frequency(const MultiplexID *id, bool in_kHz=false)
QSqlQuery wrapper that fetches a DB connection from the connection pool.
bool prepare(const QString &query)
QSqlQuery::prepare() is not thread safe in Qt <= 3.3.2.
QVariant value(int i) const
bool isActive(void) const
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
void bindValue(const QString &placeholder, const QVariant &val)
Add a single binding.
bool next(void)
Wrap QSqlQuery::next() so we can display the query results.
static MSqlQueryInfo InitCon(ConnectionReuse _reuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
Modulation(const MultiplexID *id, CardUtil::INPUT_TYPES nType)
QString GetColumnName(void) const
QString GetSetClause(MSqlBindings &bindings) const override
const MultiplexID * m_mplexId
MuxDBStorage(StorageUser *_setting, const MultiplexID *_id, const QString &_name)
QString GetWhereClause(MSqlBindings &bindings) const override
QString GetHostName(void)
static void DBError(const QString &where, const MSqlQuery &query)
Basic menu dialog, message and a list of options.
bool TranslateKeyPress(const QString &Context, QKeyEvent *Event, QStringList &Actions, bool AllowJumps=true)
Get a list of actions for a keypress in the given context.
MythScreenStack * GetStack(const QString &Stackname)
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
Screen in which all other widgets are contained and rendered.
void addSelection(const QString &label, QString value=QString(), bool select=false)
RollOff(const MultiplexID *id)
static CardUtil::INPUT_TYPES toDVBInputType(const QString &deviceid)
SignalPolarity(const MultiplexID *id)
static uint GetSourceID(const QString &name)
virtual void addChild(StandardSetting *child)
virtual void setName(const QString &name)
void settingsChanged(StandardSetting *selectedSetting=nullptr)
virtual void setHelpText(const QString &str)
virtual void removeChild(StandardSetting *child)
void setVisible(bool visible)
virtual void setValue(const QString &newValue)
void valueChanged(const QString &newValue)
virtual QString getValue(void) const
virtual void setLabel(QString str)
virtual QString GetDBValue(void) const =0
CardUtil::INPUT_TYPES m_cardtype
void SetSourceID(uint sourceid)
QVector< StandardSetting * > m_list
TransportListEditor(uint initial_sourceid)
void Delete(TransportSetting *transport)
void Menu(TransportSetting *transport)
VideoSourceShow * m_videosource
bool keyPressEvent(QKeyEvent *event) override
TransportSetting(const QString &label, uint mplexid, uint sourceid, CardUtil::INPUT_TYPES cardtype)
void resultEdit(DialogCompletionEvent *) override
void edit(MythScreenType *) override
VideoSourceID(const MultiplexID *id, uint _sourceid)
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
QMap< QString, QVariant > MSqlBindings
typedef for a map of string -> string bindings for generic queries.
MythConfirmationDialog * ShowOkPopup(const QString &message, bool showCancel)
Non-blocking version of MythPopupBox::showOkPopup()
MythMainWindow * GetMythMainWindow(void)
static MythThemedMenu * menu
static CardUtil::INPUT_TYPES get_cardtype(uint sourceid)
static QString pp_modulation(const QString &mod)
VERBOSE_PREAMBLE Most true