2010年7月28日 星期三

GPS

NMEA data
http://www.gpsinformation.org/dale/nmea.htm

HOWTO: Track your position using a GPS dongle and Google Earth
http://ubuntuforums.org/showthread.php?t=1083710

Using A Bluetooth GPS From Python
http://www.robertprice.co.uk/robblog/archive/2007/1/Using_A_Bluetooth_GPS_From_Python.shtml

教學

將win7安裝光碟放到USB隨身碟中
http://rondoyoyo.pixnet.net/blog/post/29644836

將AVI+字幕轉VCD或DVD使用教學
http://oz6877.myweb.hinet.net/2.htm

2010年7月13日 星期二

Qt 讀取MP3的ID3 tag

MP3資訊目前都是以ID3的tag標示

目前常見的標示有ID3v1, ID3v2.3, ID3v2.4

讀取方式大同小異但在v1和v2.3的編碼方式為Big5所以讀取時要比較注意一點

關於各欄位資訊可參照Wikipedia

http://en.wikipedia.org/wiki/ID3

下面提供簡單的讀取範例

QFile *file=new QFile(MP3檔案路徑);
if (!file->open(QIODevice::ReadOnly))
{
qDebug()<<"return";
return;
}
QTextCodec *codec = QTextCodec::codecForName("Big5");
QString head = file->read(3);
QString sver = file->read(1);
int ver = sver.at(0).toAscii();

//移到倒數第128個位置
file->seek(file->size()-128);

QString tag = file->read(3);
qDebug()<<"tag"<
QString title = codec->toUnicode(file->read(30));
QString artist = codec->toUnicode(file->read(30));
QString album = codec->toUnicode(file->read(30));
QString year = codec->toUnicode(file->read(4));
QString comment = codec->toUnicode(file->read(30));

qDebug()<<"head"< qDebug()<<"ver"< qDebug()<<"title"< qDebug()<<"artist"< qDebug()<<"album"< qDebug()<<"year"< qDebug()<<"comment"< file->close();