60 if (mod.endsWith(
"vsb"))
61 return mod.left(mod.length() - 3) +
"-VSB";
63 if (mod.startsWith(
"qam_"))
64 return "QAM-" + mod.mid(4, mod.length());
67 return QObject::tr(
"Analog");
74 std::vector<uint> cardids;
79 "SELECT capturecard.cardid "
81 "WHERE capturecard.sourceid = :SOURCEID AND "
82 " capturecard.parentid = 0 AND "
83 " capturecard.hostname = :HOSTNAME");
93 cardids.push_back(query.
value(0).toUInt());
98 "Sorry, the Transport Editor can only edit transports "
99 "of a video source that is connected to a capture card."));
104 std::vector<CardUtil::INPUT_TYPES> cardtypes;
106 for (
uint cardid : cardids)
110 if (cardtype ==
"DVB")
135 "Failed to probe a capture card connected to this "
136 "transport's video source. Please make sure the "
137 "backend is not running."));
142 cardtypes.push_back(nType);
146 if (cardtypes.empty())
151 for (
size_t i = 1; i < cardtypes.size(); i++)
171 "The capture cards connected to this transport's video source "
172 "are incompatible. Please create separate video sources "
173 "per capture card type."));
180 for (
size_t i = 1; i < cardtypes.size(); i++)
189 retval = cardtypes[i];
198 for (
auto *setting : std::as_const(
m_list))
254 "SELECT mplexid, modulation, frequency, "
255 " symbolrate, networkid, transportid, "
256 " constellation, mod_sys "
257 "FROM dtv_multiplex, videosource "
258 "WHERE dtv_multiplex.sourceid = :SOURCEID AND "
259 " dtv_multiplex.sourceid = videosource.sourceid "
260 "ORDER by networkid, transportid, frequency, mplexid");
274 query.
value(6).toString() : query.
value(1).toString();
277 while (mod.length() < 7)
280 QString rate = query.
value(3).toString();
281 rate = (rate ==
"0") ?
"" : QString(
"rate %1").arg(rate);
283 QString netid = query.
value(4).toUInt() ?
284 QString(
"netid %1").arg(query.
value(4).toUInt(), 5) :
"";
286 QString tid = query.
value(5).toUInt() ?
287 QString(
"tid %1").arg(query.
value(5).toUInt(), 5) :
"";
298 type = QString(
"(%1)").arg(query.
value(7).toString());
306 QString txt = QString(
"%1 %2 %3 %4 %5 %6 %7")
307 .arg(mod, query.
value(2).toString(),
308 hz, rate, netid, tid,
type);
313 this, [transport,
this] () {
Delete(transport); });
315 this, [transport,
this] () {
Menu(transport); });
317 m_list.push_back(transport);
330 m_list.push_back(transport);
341 tr(
"Are you sure you would like to delete this transport?"),
343 [transport,
this](
bool result)
351 query.
prepare(
"DELETE FROM dtv_multiplex WHERE mplexid = :MPLEXID");
357 query.
prepare(
"UPDATE channel SET deleted = NOW() "
358 "WHERE deleted IS NULL AND mplexid = :MPLEXID");
365 m_list.removeAll(transport);
375 auto *
menu =
new MythMenu(tr(
"Transport Menu"),
this,
"transportmenu");
376 menu->AddItem(tr(
"Delete..."), [transport,
this] () {
Delete(transport); });
381 menuPopup->SetReturnEvent(
this,
"transportmenu");
383 if (menuPopup->Create())
445 bool is_atsc_country) :
448 setLabel(QObject::tr(
"Digital TV Standard"));
450 "Guiding standard to use for making sense of the "
451 "data streams after they have been demodulated, "
452 "error corrected and demultiplexed."));
472 QString hz = (in_kHz) ?
"kHz" :
"Hz";
473 setLabel(QObject::tr(
"Frequency") +
" (" + hz +
")");
475 "Frequency (Option has no default).\n"
476 "The frequency for this transport (multiplex) in") +
" " + hz +
".");
486 setLabel(QObject::tr(
"Symbol Rate"));
489 "Symbol Rate (symbols/sec).\n"
490 "Most DVB-S transponders transmit at 27.5 "
491 "million symbols per second."));
511 setLabel(QObject::tr(
"Symbol Rate"));
514 "Symbol Rate (symbols/second).\n"
515 "Most DVB-C transports transmit at 6.9 or 6.875 "
516 "million symbols per second."));
533 setHelpText(QObject::tr(
"Polarity (Option has no default)"));
550 (
CardUtil::INPUT_TYPES::DVBT2 == nType)) ?
551 "constellation" :
"modulation")
553 setLabel(QObject::tr(
"Modulation"));
554 setHelpText(QObject::tr(
"Modulation, aka Constellation"));
606 setHelpText(QObject::tr(
"Inversion (Default: Auto):\n"
607 "Most cards can autodetect this now, so leave it at Auto"
608 " unless it won't work."));
622 setHelpText(QObject::tr(
"Bandwidth (Default: Auto)"));
637 setHelpText(QObject::tr(
"Bandwidth for DVB-T2 (Default: Auto)"));
678 setHelpText(QObject::tr(
"Forward Error Correction (Default: Auto)"));
690 setLabel(QObject::tr(
"LP Coderate"));
691 setHelpText(QObject::tr(
"Low Priority Code Rate (Default: Auto)"));
703 setLabel(QObject::tr(
"HP Coderate"));
704 setHelpText(QObject::tr(
"High Priority Code Rate (Default: Auto)"));
714 setLabel(QObject::tr(
"Guard Interval"));
715 setHelpText(QObject::tr(
"Guard Interval for DVB-T (Default: Auto)"));
730 setLabel(QObject::tr(
"Guard Interval"));
731 setHelpText(QObject::tr(
"Guard Interval for DVB-T2 (Default: Auto)"));
749 setLabel(QObject::tr(
"Transmission Mode"));
750 setHelpText(QObject::tr(
"Transmission Mode for DVB-T (Default: Auto)"));
766 setLabel(QObject::tr(
"Transmission Mode"));
767 setHelpText(QObject::tr(
"Transmission Mode for DVB-T2 (Default: Auto)"));
785 setHelpText(QObject::tr(
"Hierarchy (Default: Auto)"));
800 setLabel(QObject::tr(
"Modulation System"));
801 setHelpText(QObject::tr(
"Modulation System (Default: DVB-T2)"));
813 setLabel(QObject::tr(
"Modulation System"));
814 setHelpText(QObject::tr(
"Modulation System (Default: DVB-S2)"));
826 setLabel(QObject::tr(
"Modulation System"));
827 setHelpText(QObject::tr(
"Modulation System (Default: DVB-C/A)"));
841 setHelpText(QObject::tr(
"Roll-off factor (Default: 0.35)"));
940 for (
int i = 0; i < actions.size() && !handled; i++)
942 const QString&
action = actions[i];
949 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