kaffeine-1.2.2/ 0000755 0001750 0001750 00000000000 11552636277 012730 5 ustar lxuser lxuser kaffeine-1.2.2/.krazy 0000644 0001750 0001750 00000000017 11552636277 014067 0 ustar lxuser lxuser SKIP /include/
kaffeine-1.2.2/deviceactions/ 0000755 0001750 0001750 00000000000 11552636277 015550 5 ustar lxuser lxuser kaffeine-1.2.2/deviceactions/kaffeine_play_dvd.desktop 0000644 0001750 0001750 00000004165 11552636277 022603 0 ustar lxuser lxuser [Desktop Entry]
Type=Service
Actions=PlayDVD;
X-KDE-Solid-Predicate=OpticalDisc.availableContent & 'VideoDvd'
[Desktop Action PlayDVD]
Name=Play DVD with Kaffeine
Name[bg]=Възпроизвеждане на DVD с Kaffeine
Name[ca]=Reprodueix DVD amb Kaffeine
Name[ca@valencia]=Reprodueix DVD amb Kaffeine
Name[cs]=Přehrát DVD v Kaffeine
Name[csb]=Grôj DVD w Kaffeine
Name[da]=Afspil dvd med Kaffeine
Name[de]=DVD mit Kaffeine abspielen
Name[el]=Αναπαραγωγή DVD με το Kaffeine
Name[en_GB]=Play DVD with Kaffeine
Name[es]=Reproducir DVD con Kaffeine
Name[et]=Esita DVD Kaffeine'is
Name[fi]=Toista DVD-levy Kaffeinessa
Name[fr]=Lire un DVD avec Kaffeine
Name[ga]=Seinn DVD le Kaffeine
Name[gl]=Reproducir o DVD con Kaffeine
Name[hr]=Reproduciraj DVD s Kaffeineom
Name[hu]=DVD lejátszása a Kaffeine-nel
Name[is]=Spila DVD með Kaffeine
Name[it]=Riproduci DVD con Kaffeine
Name[km]=ចាក់ឌីវីឌីដោយប្រើ Kaffeine
Name[ko]=Kaffeine으로 DVD 재생하기
Name[lt]=Groti DVD su Kaffeine
Name[lv]=Atskaņot DVD ar Kaffeine
Name[nb]=Spill av DVD med Kaffeine
Name[nds]=DVD mit Kaffeine afspelen
Name[ne]=क्याफिनसँग डीभीडी प्ले गर्नुहोस्
Name[nl]=DVD met Kaffeine afspelen
Name[pa]=ਕੈਫ਼ੀਨ ਨਾਲ DVD ਚਲਾਓ
Name[pl]=Odtwarzaj DVD w Kaffeine
Name[pt]=Ver o DVD com o Kaffeine
Name[pt_BR]=Reproduzir DVD com o Kaffeine
Name[ro]=Redare DVD cu Kaffeine
Name[ru]=Воспроизвести DVD в Kaffeine
Name[sk]=Prehrať DVD v Kaffeine
Name[sr]=Пусти ДВД Кафеином
Name[sr@ijekavian]=Пусти ДВД Кафеином
Name[sr@ijekavianlatin]=Pusti DVD Kaffeineom
Name[sr@latin]=Pusti DVD Kaffeineom
Name[sv]=Spela dvd med Kaffeine
Name[tg]=Намоиши DVD бо Kaffeine
Name[th]=เล่นแผ่นดีวีดีด้วย 'แคฟเฟอีน-K'
Name[tr]=DVD'yi Kaffeine ile Oynat
Name[uk]=Відтворити DVD за допомогою Kaffeine
Name[x-test]=xxPlay DVD with Kaffeinexx
Name[zh_CN]=用 Kaffeine 播放 DVD
Name[zh_TW]=用 Kaffeine 播放 DVD
Exec=kaffeine --dvd %d
Icon=kaffeine
kaffeine-1.2.2/deviceactions/kaffeine_play_audiocd.desktop 0000644 0001750 0001750 00000004734 11552636277 023440 0 ustar lxuser lxuser [Desktop Entry]
Type=Service
Actions=PlayAudioCd;
X-KDE-Solid-Predicate=OpticalDisc.availableContent & 'Audio'
[Desktop Action PlayAudioCd]
Name=Play Audio CD with Kaffeine
Name[bg]=Възпроизвеждане на аудио CD с Kaffeine
Name[ca]=Reprodueix CD d'àudio amb Kaffeine
Name[ca@valencia]=Reprodueix CD d'àudio amb Kaffeine
Name[cs]=Přehrát audio CD v Kaffeine
Name[csb]=Grôj Aùdio CD w Kaffeine
Name[da]=Afspil lyd-cd med Kaffeine
Name[de]=Audio-CD mit Kaffeine abspielen
Name[el]=Αναπαραγωγή CD ήχου με το Kaffeine
Name[en_GB]=Play Audio CD with Kaffeine
Name[es]=Reproducir CD de audio con Kaffeine
Name[et]=Esita audio-CD Kaffeine'is
Name[fi]=Soita musiikki-CD Kaffeinessa
Name[fr]=Lire un CD Audio avec Kaffeine
Name[ga]=Seinn Dlúthdhiosca Fuaime le Kaffeine
Name[gl]=Reproducir o CD de música con Kaffeine
Name[hr]=Sviraj zvučni CD s Kaffeineom
Name[hu]=Hang-CD lejátszása a Kaffeine-nel
Name[is]=Spila hljóð-CD með Kaffeine
Name[it]=Riproduci CD audio con Kaffeine
Name[km]=ចាក់ស៊ីឌីអូឌីយ៉ូដោយប្រើ Kaffeine
Name[ko]=Kaffeine으로 오디오 CD 재생하기
Name[lt]=Groti Audio CD su Kaffeine
Name[lv]=Atskaņot Audio CD ar Kaffeine
Name[nb]=Spill av lyd-CD med Kaffeine
Name[nds]=Klang-CD mit Kaffeine afspelen
Name[ne]=क्याफिनसँग अडियो सीडी प्ले गर्नुहोस्
Name[nl]=Audio-cd met Kaffeine afspelen
Name[pa]=ਕੈਫ਼ੀਨ ਨਾਲ ਆਡੀਓ CD ਚਲਾਓ
Name[pl]=Odtwarzaj audio CD w Kaffeine
Name[pt]=Tocar o CD de Áudio com o Kaffeine
Name[pt_BR]=Reproduzir CD de áudio com o Kaffeine
Name[ro]=Redare disc audio cu Kaffeine
Name[ru]=Воспроизвести аудиодиск в Kaffeine
Name[sk]=Prehrať Audio CD v Kaffeine
Name[sr]=Пусти аудио ЦД Кафеином
Name[sr@ijekavian]=Пусти аудио ЦД Кафеином
Name[sr@ijekavianlatin]=Pusti audio CD Kaffeineom
Name[sr@latin]=Pusti audio CD Kaffeineom
Name[sv]=Spela ljud-cd med Kaffeine
Name[tg]=Навозиши диски аудио бо Kaffeine
Name[th]=เล่นแผ่นซีดีเสียงด้วย 'แคฟเฟอีน-K'
Name[tr]=Ses CD'sini Kaffeine ile Oynat
Name[uk]=Відтворити Аудіо-КД за допомогою Kaffeine
Name[x-test]=xxPlay Audio CD with Kaffeinexx
Name[zh_CN]=用 Kaffeine 播放音频 CD
Name[zh_TW]=用 Kaffeine 播放音樂光碟
Exec=kaffeine --audiocd %d
Icon=kaffeine
kaffeine-1.2.2/deviceactions/CMakeLists.txt 0000644 0001750 0001750 00000000304 11552636277 020305 0 ustar lxuser lxuser set(solid_actions
kaffeine_play_audiocd.desktop
kaffeine_play_dvd.desktop
kaffeine_play_videocd.desktop)
install(FILES ${solid_actions} DESTINATION ${DATA_INSTALL_DIR}/solid/actions)
kaffeine-1.2.2/deviceactions/kaffeine_play_videocd.desktop 0000644 0001750 0001750 00000004111 11552636277 023432 0 ustar lxuser lxuser [Desktop Entry]
Type=Service
Actions=PlayVideoCd;
X-KDE-Solid-Predicate=[OpticalDisc.availableContent & 'VideoCd' OR OpticalDisc.availableContent & 'SuperVideoCd']
[Desktop Action PlayVideoCd]
Name=Play Video CD with Kaffeine
Name[bg]=Възпроизвеждане на CD с видео с Kaffeine
Name[ca]=Reprodueix CD de vídeo amb Kaffeine
Name[ca@valencia]=Reprodueix CD de vídeo amb Kaffeine
Name[cs]=Přehrát VCD v Kaffeine
Name[csb]=Grôj wideò CD w Kaffeine
Name[da]=Afspil video-cd med Kaffeine
Name[de]=Video-CD mit Kaffeine abspielen
Name[en_GB]=Play Video CD with Kaffeine
Name[es]=Reproducir Vídeo CD con Kaffeine
Name[et]=Esita video-CD Kaffeine'is
Name[fi]=Toista video-CD Kaffeinessa
Name[fr]=Lire un VCD avec Kaffeine
Name[hr]=Reproduciraj video CD s Kaffeineom
Name[hu]=Video CD lejátszása a Kaffeine-nel
Name[is]=Spila Vídeó-CD með Kaffeine
Name[it]=Riproduci Video CD con Kaffeine
Name[km]=ចាក់ស៊ីឌីវីដេអូដោយប្រើ Kaffeine
Name[ko]=Kaffeine으로 비디오 CD 재생하기
Name[nb]=Spill Video-VCD med Kaffeine
Name[nds]=Video-CD mit Kaffeine afspelen
Name[nl]=Video-cd met Kaffeine afspelen
Name[pa]=ਕੈਫ਼ੀਨ ਨਾਲ ਵਿਡੀਓ CD ਚਲਾਓ
Name[pt]=Ver o CD de Vídeo com o Kaffeine
Name[pt_BR]=Reproduzir CD de vídeo com o Kaffeine
Name[ro]=Redare disc video cu Kaffeine
Name[ru]=Воспроизвести Video CD в Kaffeine
Name[sk]=Prehrať Video CD v Kaffeine
Name[sr]=Пусти видео ЦД Кафеином
Name[sr@ijekavian]=Пусти видео ЦД Кафеином
Name[sr@ijekavianlatin]=Pusti video CD Kaffeineom
Name[sr@latin]=Pusti video CD Kaffeineom
Name[sv]=Spela video-cd med Kaffeine
Name[th]=เล่นแผ่นซีดีวีดิโอด้วย 'แคฟเฟอีน-K'
Name[tr]=Video CD'sini Kaffeine ile Oynat
Name[uk]=Відтворити відео-КД за допомогою Kaffeine
Name[x-test]=xxPlay Video CD with Kaffeinexx
Name[zh_CN]=用 Kaffeine 播放视频 CD
Name[zh_TW]=用 Kaffeine 播放影像光碟
Exec=kaffeine --videocd %d
Icon=kaffeine
kaffeine-1.2.2/Changelog 0000644 0001750 0001750 00000006232 11552636277 014545 0 ustar lxuser lxuser ------------------
Kaffeine Changelog
------------------
Version 1.2.2 (2011-04-17):
- fix crash after removing channels
Version 1.2.1 (2011-04-05):
- fix dvb-s2 tuning regression
Version 1.2 (2011-04-04):
- add search function to epg
- implement ATSC support for epg
- fix gnome screen saver inhibition
- other fixes and improvements ...
Version 1.1 (2010-09-01):
- adapt to new shared-mime-info (so that .m2t is assigned to kaffeine again)
- workaround issue that video isn't shown without changing tabs when using QT 4.7
- recording schedule: fix sorting, improve column and dialog sizes,
show a warning about active and pending recordings when closing kaffeine
- program guide: remove the "Refresh" button (not necessary anymore)
- channel editor: allow sorting by drag and drop
Version 1.0 (2010-05-31):
- new dependency: libXss
- scheduled programs are shown in the program guide
- the begin and end margins for recordings are configurable
- CICAM is supported
- all audio pids are recorded during timeshift
- subtitle support (also autoloading)
- other fixes and improvements ...
Version 1.0-pre3 (2010-01-31):
- new dependencies: Qt SQLite plugin, xine-lib, libX11
(Phonon is no longer needed)
- added configurable daily or weekly repetition of recording schedule entries
- added support for dynamic audio / subtitles streams
- reworked playlist support
- added DBUS interface and partial MPRIS support
- added dvd menu button and deinterlace option
- added system tray icon and minimal mode option
- other fixes and improvements ...
Version 1.0-pre2 (2009-08-09):
- added screen saver inhibition (using DBUS; org.freedesktop.ScreenSaver)
- added basic playlist features: .m3u, .pls, .xspf (+ old kaffeine format),
drag and drop, repeat mode and shuffle
- added OSD: various notifications, now and next epg
- added DVB-S2 support using S2 API (old API still supported for non-S2 usage)
- improved epg: save and restore events, possibility to schedule programs
- other fixes and improvements ...
Version 1.0-pre1 (2009-04-26):
- initial KDE4 release based on KDE4, QT4, Phonon and Solid
much of the code base was rewritten;
as a consequence not all features from old kaffeine are present yet
- supports:
- KDE integration
- DVB-C, DVB-S, DVB-T and ATSC devices
- multiple devices and device hot plug
- scanning inclusive region-based DVB-T Autoscan
- audio stream and subtitle selection
- recordings inclusive instant record
- time shifting
- EPG (incomplete)
- audio CDs, video CDs and DVDs
- stuff you might miss: (working hard on them of course ;-)
- localization (see below), full EPG support, CICAM, playlist handling,
OSD, S2API, broadcast, DBUS interface
- note: there will be a follow-up release in 1 - 1.5 months fixing important
shortcomings and also giving time for translations
- note: KDE 4.2, Phonon 4.3 and QT 4.4 are required to build / run Kaffeine
- note: Kaffeine currently depends on phonon-xine for digital TV playback
(due to the used phonon API)
- note: you have to reconfigure / rescan if you were using snapshots before
kaffeine-1.2.2/tools/ 0000755 0001750 0001750 00000000000 11552636277 014070 5 ustar lxuser lxuser kaffeine-1.2.2/tools/update_icons.sh 0000755 0001750 0001750 00000000725 11552636277 017110 0 ustar lxuser lxuser #!/bin/sh
set -eu
cd kaffeine/icons
rm -f hi*
if [ `find /usr/share/icons/oxygen | grep -i kaffeine | wc --lines` != 6 ] ; then
echo "recheck number of icons"
exit 1
fi
for SIZE in 16 22 32 48 64 128 ; do
wget http://websvn.kde.org/*checkout*/trunk/kdesupport/oxygen-icons/$SIZE'x'$SIZE/apps/kaffeine.png -O hi$SIZE-apps-kaffeine.png
done
wget http://websvn.kde.org/*checkout*/trunk/kdesupport/oxygen-icons/scalable/apps/kaffeine.svgz -O hisc-apps-kaffeine.svgz
kaffeine-1.2.2/tools/update_scanfile.sh 0000755 0001750 0001750 00000000277 11552636277 017563 0 ustar lxuser lxuser #!/bin/sh
set -eu
mkdir -p kaffeine_build
cd kaffeine_build
cmake ../kaffeine -DBUILD_TOOLS=1
make convertscanfiles
tools/convertscanfiles ../dvb-apps/util/scan ../kaffeine/src/scanfile.dvb
kaffeine-1.2.2/tools/update_mimetypes.sh 0000755 0001750 0001750 00000000313 11552636277 020002 0 ustar lxuser lxuser #!/bin/sh
set -eu
mkdir -p kaffeine_build
cd kaffeine_build
cmake ../kaffeine -DBUILD_TOOLS=1
make updatemimetypes
tools/updatemimetypes ../kaffeine/src/kaffeine.desktop ../kaffeine/src/mediawidget.cpp
kaffeine-1.2.2/tools/update_l10n.sh 0000755 0001750 0001750 00000001641 11552636277 016545 0 ustar lxuser lxuser #!/bin/sh
set -eu
cd kaffeine
rm -fr po
mkdir po
cd po
cat >CMakeLists.txt << EOF
find_package(Gettext REQUIRED)
IF(NOT GETTEXT_MSGFMT_EXECUTABLE)
MESSAGE(FATAL_ERROR "Please install the msgfmt binary")
endif(NOT GETTEXT_MSGFMT_EXECUTABLE)
if(NOT GETTEXT_MSGMERGE_EXECUTABLE)
MESSAGE(FATAL_ERROR "Please install the msgmerge binary")
endif(NOT GETTEXT_MSGMERGE_EXECUTABLE)
EOF
wget http://websvn.kde.org/*checkout*/trunk/l10n-kde4/subdirs
SUBDIRS=$(cat subdirs | grep -vx "x-test")
rm subdirs
for SUBDIR in $SUBDIRS ; do
mkdir $SUBDIR
cd $SUBDIR
wget http://websvn.kde.org/*checkout*/trunk/l10n-kde4/$SUBDIR/messages/extragear-multimedia/kaffeine.po || true
cd ..
if test -e $SUBDIR/kaffeine.po ; then
echo "add_subdirectory($SUBDIR)" >>CMakeLists.txt
echo "GETTEXT_PROCESS_PO_FILES($SUBDIR ALL INSTALL_DESTINATION \${LOCALE_INSTALL_DIR} kaffeine.po)" >$SUBDIR/CMakeLists.txt
else
rmdir $SUBDIR
fi
done
kaffeine-1.2.2/tools/dvbsi.xml 0000644 0001750 0001750 00000017220 11552636277 015723 0 ustar lxuser lxuser
kaffeine-1.2.2/tools/update_headers.sh 0000755 0001750 0001750 00000000702 11552636277 017403 0 ustar lxuser lxuser #!/bin/sh
set -eu
cd kaffeine/include
rm -fr *
wget "http://git.linuxtv.org/linux-2.6.git?a=blob_plain;f=include/linux/dvb/dmx.h;hb=HEAD" -O dmx.h.1
wget "http://git.linuxtv.org/linux-2.6.git?a=blob_plain;f=include/linux/dvb/frontend.h;hb=HEAD" -O frontend.h.1
unifdef -k -U__KERNEL__ dmx.h.1 >dmx.h || true
unifdef -k -U__KERNEL__ frontend.h.1 >frontend.h || true
sed 'N;s/,\n\}/\n\}/;P;D;' -i dmx.h
sed 'N;s/,\n\}/\n\}/;P;D;' -i frontend.h
rm *.1
kaffeine-1.2.2/tools/updatemimetypes.cpp 0000644 0001750 0001750 00000011506 11552636277 020016 0 ustar lxuser lxuser /*
* updatemimetypes.cpp
*
* Copyright (C) 2010 Christoph Pfister
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include
#include
#include
#include
int main(int argc, char *argv[])
{
// QCoreApplication is needed for proper file name handling
QCoreApplication application(argc, argv);
if (argc != 3) {
qCritical() << "syntax:" << argv[0] << " ";
return 1;
}
QFile file(argv[1]);
QStringList lines;
{
if (!file.open(QFile::ReadOnly)) {
qCritical() << "cannot open file" << file.fileName();
return 1;
}
QTextStream stream(&file);
stream.setCodec("UTF-8");
while (!stream.atEnd()) {
lines.append(stream.readLine());
}
file.close();
}
int mimeTypeIndex = -1;
QStringList mimeTypes;
for (int i = 0; i < lines.size(); ++i) {
if (lines.at(i).startsWith(QLatin1String("MimeType="))) {
if (mimeTypeIndex >= 0) {
qCritical() << "more than one MimeType entry found in file" <<
file.fileName();
return 1;
}
mimeTypeIndex = i;
mimeTypes = lines.at(i).mid(9).split(';', QString::SkipEmptyParts);
}
}
if (mimeTypeIndex < 0) {
qCritical() << "cannot find a MimeType entry in file" << file.fileName();
return 1;
}
mimeTypes.removeDuplicates();
mimeTypes.sort();
QStringList realExtensions;
for (int skipMimeType = -1; skipMimeType < mimeTypes.size(); ++skipMimeType) {
QStringList extensions;
for (int i = 0; i < mimeTypes.size(); ++i) {
if (i != skipMimeType) {
KMimeType::Ptr mimetype = KMimeType::mimeType(mimeTypes.at(i),
KMimeType::DontResolveAlias);
if (mimetype.isNull()) {
qCritical() << "unknown mime type" << mimeTypes.at(i);
return 1;
}
extensions.append(mimetype->patterns());
}
}
QRegExp regExp("\\*\\.[a-z0-9+]+");
for (int i = 0; i < extensions.size(); ++i) {
if (extensions.at(i) == "*.anim[1-9j]") {
extensions.removeAt(i);
extensions.insert(i, "*.anim1");
extensions.insert(i, "*.anim2");
extensions.insert(i, "*.anim3");
extensions.insert(i, "*.anim4");
extensions.insert(i, "*.anim5");
extensions.insert(i, "*.anim6");
extensions.insert(i, "*.anim7");
extensions.insert(i, "*.anim8");
extensions.insert(i, "*.anim9");
extensions.insert(i, "*.animj");
}
if (!regExp.exactMatch(extensions.at(i))) {
qCritical() << "unknown extension syntax" << extensions.at(i);
return 1;
}
}
extensions.removeDuplicates();
extensions.sort();
if (realExtensions.isEmpty()) {
realExtensions = extensions;
} else if (extensions.size() == realExtensions.size()) {
qWarning() << "possibly unneeded mime type found" <<
mimeTypes.at(skipMimeType);
}
}
{
if (!file.open(QFile::WriteOnly | QFile::Truncate)) {
qCritical() << "cannot open file" << file.fileName();
return 1;
}
QTextStream stream(&file);
stream.setCodec("UTF-8");
lines[mimeTypeIndex] = "MimeType=" + mimeTypes.join(";") + ';';
foreach (const QString &line, lines) {
stream << line << '\n';
}
file.close();
}
file.setFileName(argv[2]);
lines.clear();
{
if (!file.open(QFile::ReadOnly)) {
qCritical() << "cannot open file" << file.fileName();
return 1;
}
QTextStream stream(&file);
stream.setCodec("UTF-8");
while (!stream.atEnd()) {
lines.append(stream.readLine());
}
file.close();
}
{
if (!file.open(QFile::WriteOnly | QFile::Truncate)) {
qCritical() << "cannot open file" << file.fileName();
return 1;
}
QTextStream stream(&file);
stream.setCodec("UTF-8");
for (int i = 0; i < lines.size(); ++i) {
stream << lines.at(i) << '\n';
if (lines.at(i) == "\t\t// generated from kaffeine.desktop's mime types") {
QString line = "\t\t\"";
foreach (const QString &extension, realExtensions) {
if ((line.size() + extension.size()) > 83) {
stream << line << "\"\n";
line = "\t\t\"";
}
line += extension;
line += ' ';
}
stream << line << "\"\n";
while ((i < lines.size()) &&
(lines.at(i) != "\t\t// manual entries")) {
++i;
}
stream << lines.at(i) << '\n';
}
}
file.close();
}
return 0;
}
kaffeine-1.2.2/tools/convertscanfiles.cpp 0000644 0001750 0001750 00000020031 11552636277 020140 0 ustar lxuser lxuser /*
* convertscanfiles.cpp
*
* Copyright (C) 2008-2009 Christoph Pfister
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include
#include
#include
#include
#include "../src/dvb/dvbtransponder.h"
class NumericalLessThan
{
public:
bool operator()(const QString &x, const QString &y)
{
int i = 0;
while (true) {
if ((i == x.length()) || (i == y.length())) {
return x.length() < y.length();
}
if (x.at(i) != y.at(i)) {
break;
}
++i;
}
int xIndex = x.indexOf(' ', i);
if (xIndex == -1) {
xIndex = x.length();
}
int yIndex = y.indexOf(' ', i);
if (yIndex == -1) {
yIndex = y.length();
}
if (xIndex != yIndex) {
return xIndex < yIndex;
} else {
return x.at(i) < y.at(i);
}
}
};
static QString parseLine(DvbTransponderBase::TransmissionType type, const QString &line, const QString &fileName)
{
switch (type) {
case DvbTransponderBase::DvbC: {
DvbCTransponder transponder;
if (!transponder.fromString(line)) {
break;
}
if (transponder.modulation == DvbCTransponder::ModulationAuto) {
qWarning() << "Warning: modulation == AUTO in file" << fileName;
}
if (transponder.fecRate != DvbCTransponder::FecNone) {
qWarning() << "Warning: fec rate != NONE in file" << fileName;
}
return transponder.toString();
}
case DvbTransponderBase::DvbS: {
if (line.startsWith(QLatin1String("S "))) {
DvbSTransponder transponder;
if (!transponder.fromString(line)) {
break;
}
if (transponder.fecRate == DvbSTransponder::FecNone) {
qWarning() << "Warning: fec rate == NONE in file" << fileName;
}
// fecRate == AUTO is ok
return transponder.toString();
} else {
DvbS2Transponder transponder;
if (!transponder.fromString(line)) {
break;
}
if (transponder.fecRate == DvbSTransponder::FecNone) {
qWarning() << "Warning: fec rate == NONE in file" << fileName;
}
// fecRate == AUTO is ok
return transponder.toString();
}
}
case DvbTransponderBase::DvbT: {
DvbTTransponder transponder;
if (!transponder.fromString(line)) {
break;
}
if (transponder.bandwidth == DvbTTransponder::BandwidthAuto) {
qWarning() << "Warning: bandwidth == AUTO in file" << fileName;
}
if ((transponder.modulation == DvbTTransponder::ModulationAuto) && !fileName.startsWith("auto-")) {
qWarning() << "Warning: modulation == AUTO in file" << fileName;
}
if (transponder.fecRateHigh == DvbTTransponder::FecNone) {
qWarning() << "Warning: fec rate high == NONE in file" << fileName;
}
// fecRateHigh == AUTO is ok
if (transponder.fecRateLow != DvbTTransponder::FecNone) {
qWarning() << "Warning: fec rate low != NONE in file" << fileName;
}
if ((transponder.transmissionMode == DvbTTransponder::TransmissionModeAuto) && !fileName.startsWith("auto-")) {
qWarning() << "Warning: transmission mode == AUTO in file" << fileName;
}
if ((transponder.guardInterval == DvbTTransponder::GuardIntervalAuto) && !fileName.startsWith("auto-")) {
qWarning() << "Warning: guard interval == AUTO in file" << fileName;
}
if (transponder.hierarchy != DvbTTransponder::HierarchyNone) {
qWarning() << "Warning: hierarchy != NONE in file" << fileName;
}
return transponder.toString();
}
case DvbTransponderBase::Atsc: {
AtscTransponder transponder;
if (!transponder.fromString(line)) {
break;
}
if (transponder.modulation == AtscTransponder::ModulationAuto) {
qWarning() << "Warning: modulation == AUTO in file" << fileName;
}
return transponder.toString();
}
}
return QString();
}
static void readScanDirectory(QTextStream &out, const QString &path, DvbTransponderBase::TransmissionType type)
{
QDir dir;
switch (type) {
case DvbTransponderBase::DvbC:
dir.setPath(path + "/dvb-c");
break;
case DvbTransponderBase::DvbS:
dir.setPath(path + "/dvb-s");
break;
case DvbTransponderBase::DvbS2:
break;
case DvbTransponderBase::DvbT:
dir.setPath(path + "/dvb-t");
break;
case DvbTransponderBase::Atsc:
dir.setPath(path + "/atsc");
break;
}
if (!dir.exists()) {
qCritical() << "Error: can't open directory" << dir.path();
return;
}
foreach (const QString &fileName, dir.entryList(QDir::Files, QDir::Name)) {
QFile file(dir.filePath(fileName));
if (!file.open(QIODevice::ReadOnly)) {
qCritical() << "Error: can't open file" << file.fileName();
return;
}
QTextStream stream(&file);
stream.setCodec("UTF-8");
QList transponders;
while (!stream.atEnd()) {
QString line = stream.readLine();
int pos = line.indexOf('#');
if (pos != -1) {
while ((pos > 0) && (line[pos - 1] == ' ')) {
--pos;
}
line.truncate(pos);
}
if (line.isEmpty()) {
continue;
}
QString string = parseLine(type, line, fileName);
if (string.isEmpty()) {
qCritical() << "Error: can't parse line" << line << "in file" << fileName;
return;
}
// reduce multiple spaces to one space and remove leading zeros
for (int i = 1; i < line.length(); ++i) {
if (line.at(i - 1) != ' ') {
continue;
}
if ((line.at(i) == ' ') || (line.at(i) == '0')) {
line.remove(i, 1);
--i;
}
}
if (line != string) {
qWarning() << "Warning: suboptimal representation" << line << "<-->" << string << "in file" << fileName;
}
transponders.append(string);
}
if (transponders.isEmpty()) {
qWarning() << "Warning: no transponder found in file" << fileName;
continue;
}
QString name = dir.dirName() + '/' + fileName;
if (type == DvbSTransponder::DvbS) {
// use upper case for orbital position
name[name.size() - 1] = name.at(name.size() - 1).toUpper();
QString source = name;
source.remove(0, source.lastIndexOf('-') + 1);
bool ok = false;
if (source.endsWith('E')) {
source.chop(1);
source.toDouble(&ok);
} else if (source.endsWith('W')) {
source.chop(1);
source.toDouble(&ok);
}
if (!ok) {
qWarning() << "Warning: invalid orbital position for file" << fileName;
}
}
out << '[' << name << "]\n";
qSort(transponders.begin(), transponders.end(), NumericalLessThan());
foreach (const QString &transponder, transponders) {
out << transponder << '\n';
}
}
}
int main(int argc, char *argv[])
{
// QCoreApplication is needed for proper file name handling
QCoreApplication app(argc, argv);
if (argc != 3) {
qCritical() << "Syntax: convertscanfiles