Fold All / Expand All

2011年3月30日 星期三

SSH Tunnel設定備份

將local端的26000對應到www.google.com:80
將local端的26000對應到www.google.com:80
apply後,只要在瀏覽器網址列輸入「http://localhost:26000」,就會透過ssh連到的主機連上google頁面
如果是在Linux上用ssh連線,則可以用「ssh -L 26000:www.google.com:80 username@host.com」


建立SOCKS 5 Proxy,對應到local端的36000
如果是在Linux上用ssh連線,則可以用「ssh -D 36000 username@host.com」



Firefox Proxy設定頁面

2011年3月29日 星期二

Safari來訪次數與Chrome不相上下?

Blogger新增的Stats功能,不需要另外加入自訂語法,就可以擁有基本的訪客統計,包括最多人看的post、訪客的國家所在、使用的瀏覽器,傷當方便。

不過今天看了一下audience tag的Pageviews by Browsers,似乎有些奇怪啊,in week的Chrome pageview是391,Safari是378,Opera才45!以往應該都是Safari只比Opera高一點點,這回竟然逼近Chrome了,再看in day,竟然Safari 70、Chrome 56、Firefox 56,莫非五四三轉型成Apple向網站了!?

話說這幾天的確是多了幾篇dmap,有Apple TV關鍵字的文章。

但是看Pageviews by Operating Systems,in week的Macintosh也才57、iPhone 49,還有2百多個pageview難道是來自Windows Safari!?unbelievable! いや、むしろ impossible,真的有人會拿Windows Safari當daily browser嗎?

這時候只能調Google Analytics出來比對啦,Mar 23~Mar 29,
visits of Chrome: 392
visits of Safari: 32
visits of Macintosh: 44
visits of iPhone: 4

這才合理吧

2011年3月27日 星期日

小心使用 -webkit-text-size-adjust: none;

2013年10月23日更新
no more -webkit-text-size-adjust: none; after Chrome 27
Chrome 不吃這個屬性了

話說我們家的UI字型是用11px,而Google Chrome預設minimum font size是12px,所以很多設計師在Firefox上調整好的樣式,在Google Chrome會因為字比較大,而造成排版上的問題。在開發初期也沒有找到什麼解決方案,所以只能記得要在Google Chrome上測試,注意有沒有字被切掉的問題。

後來有天設計師跑來告訴我們,在網路上看到有人說解決Chrome minimum font size的方法,也就是標題的「-webkit-text-size-adjust: none;」,當下一試,果然有效!讓Chrome也乖乖的以11px顯示字型。

不過再搜尋一下相關主題,發現使用這個CSS屬性會造成一個問題,Google Chrome會依照網頁所指定的字型大小,不受最小字型設定限制,但是當使用者縮放網頁,也就是zoom in/out,字型的大小仍然不會改變!

如果今天使用者放大網頁,想看清楚字,在套用了「-webkit-text-size-adjust: none;」的情況下,字型大小是不會變的,而使用者就無法透過縮放網頁來達成放大字型。就accessibility的觀點,這是很糟糕的。所以最後我們沒有套用這個屬性,測試UI時,還是記得要用Chrome檢查。這也是平面設計和網頁設計的差異,網頁設計上需要處理到各個平台造成的差異,當然可以有一個平台是能夠呈現出最符合設計的結果,其他平台有些不同,不需要精確到各個平台都看起來一模一樣,但是最基本的"功能可操作"是必須要有的。

相關連結:
Adjusting the Text Size@Safari Developer Library

2011年3月21日 星期一

an dmap tag example from iTunes to Apple TV

亂寫的Python parser
import os
import struct

# basic format of DAAP
#
# 4 byte tag | size (4 byte int) | data

dmap_type = {
1: 'ubyte',
2: 'byte',
3: 'ushort',
4: 'short',
5: 'uint',
6: 'int',
7: 'ulong',
8: 'long',
9: 'string',
10: 'date',
11: 'version',
12: 'list'
}

dmap_tags = {
'abal': {
'name': 'daap',
'type': 'uint'
},
'mlit': {
'name': 'dmap.listingitem',
'type': 'list'
},
'mikd': {
'name': 'dmap.itemkind',
'type': 'ubyte'
},
'asal': {
'name': 'daap.songalbum',
'type': 'string'
},
'asar': {
'name': 'daap.songartist',
'type': 'string'
},
'asbr': {
'name': 'daap.songbitrate',
'type': 'ushort'
},
'ascm': {
'name': 'daap.songcomment',
'type': 'string'
},
'asco': {
'name': 'daap.songcompilation',
'type': 'ubyte'
},
'ascp': {
'name': 'daap.songcomposer',
'type': 'string'
},
'asda': {
'name': 'daap.songdateadded',
'type': 'date'
},
'asdm': {
'name': 'daap.songdatemodified',
'type': 'date'
},
'asdc': {
'name': 'daap.songdisccount',
'type': 'ushort'
},
'asdn': {
'name': 'daap.songdiscnumber',
'type': 'ushort'
},
'aseq': {
'name': 'daap.songeqpreset',
'type': 'string'
},
'asgn': {
'name': 'daap.songgenre',
'type': 'string'
},
'asdt': {
'name': 'daap.songdescription',
'type': 'string'
},
'asrv': {
'name': 'daap.songrelativevolume',
'type': 'ubyte'
},
'assr': {
'name': 'daap.songsamplerate',
'type': 'uint'
},
'assz': {
'name': 'daap.songsize',
'type': 'uint'
},
'asst': {
'name': 'daap.songstarttime',
'type': 'uint'
},
'assp': {
'name': 'daap.songstoptime',
'type': 'uint'
},
'astm': {
'name': 'daap.songtime', # 233795, so it's millisecond
'type': 'uint'
},
'astc': {
'name': 'daap.songtrackcount',
'type': 'ushort'
},
'astn': {
'name': 'daap.songtracknumber',
'type': 'ushort'
},
'asur': {
'name': 'daap.songuserrating',
'type': 'ubyte'
},
'asyr': {
'name': 'daap.songyear',
'type': 'ushort'
},
'asfm': {
'name': 'daap.songformat',
'type': 'string'
},
'miid': {
'name': 'dmap.itemid',
'type': 'uint'
},
'minm': {
'name': 'dmap.itenname', # song title!!
'type': 'string'
},
'mper': {
'name': 'dmap.persistentid',
'type': 'ulong'
},
'asdb': {
'name': 'daap.songdisabled',
'type': 'ubyte'
},
'aeNV': {
'name': 'com.applie.itunes.norm-volume',
'type': 'uint'
},
'asdk': {
'name': 'daap.songdatakind',
'type': 'ubyte'
},
'asbt': {
'name': 'daap.songbeatsperminute',
'type': 'ushort'
},
'agrp': {
'name': 'daap.songgrouping',
'type': 'string'
},
'ascd': {
'name': 'daap.songcodectype',
'type': 'uint'
},
'ascs': {
'name': 'daap.songcodecsubtype',
'type': 'uint'
},
'aePC': {
'name': 'com.apple.itunes.is-podcast',
'type': 'ubyte'
},
'asct': {
'name': 'daap.songcategory',
'type': 'string'
},
'ascn': {
'name': 'daap.songcontentdescription',
'type': 'string'
},
'asky': {
'name': 'daap.songkeywords',
'type': 'string'
},
'ascr': {
'name': 'daap.songcontentrating',
'type': 'ubyte'
},
'aeHV': {
'name': 'com.apple.itunes.has-video', # important value for VIDEO support
'type': 'ubyte'
},
'aeMK': {
'name': 'com.apple.itunes.mediakind', # iTunes 10 broken reason
'type': 'ubyte'
# 1 for music??
},
'aeSN': {
'name': 'com.apple.itunes.series-name',
'type': 'string'
},
'aeNN': {
'name': 'com.apple.itunes.network-name',
'type': 'string'
},
'aeEN': {
'name': 'com.apple.itunes.episode-num-str',
'type': 'string'
},
'aeES': {
'name': 'com.apple.itunes.episode-sort',
'type': 'uint'
},
'aeSU': {
'name': 'com.apple.itunes.season-num',
'type': 'uint'
},
'aeGH': {
'name': 'com.apple.itunes.gapless-heur',
'type': 'uint'
# 1 for ??
},
'aeGD': {
'name': 'com.apple.itunes.gapless-enc-dr',
'type': 'uint'
# 3264 for ??
},
'aeGU': {
'name': 'com.apple.itunes.gapless-dur',
'type': 'ulong'
# 10306560 for ??
},
'aeGR': {
'name': 'com.apple.itunes.gapless-resy',
'type': 'ulong'
# 9343476 for ??
},
'aeGE': {
'name': 'com.apple.itunes.gapless-enc-del',
'type': 'uint'
# 576 for ??
},
'asgp': {
'name': 'daap.songgapless',
'type': 'ubyte'
},

# Unknown Key??
# from forked-daapd, but commented
'ased': {
'name': 'daap.songextradata',
'type': 'ushort'
# 1
},
'ashp': {
'name': 'daap.songhasbeenplayed',
'type': 'ubyte'
# 1
},
'assn': {
'name': 'daap.sortname',
'type': 'string'
# zero length
},
'assa': {
'name': 'daap.sortartist',
'type': 'string'
# zero length
},
'assl': {
'name': 'daap.sortalbumartist',
'type': 'string'
# zero length
},
'assu': {
'name': 'daap.sortalbum',
'type': 'string'
# zero length
},
'assc': {
'name': 'daap.sortcomposer',
'type': 'string'
# zero length
},
'asss': {
'name': 'daap.sortseriesname',
'type': 'string'
# zero length
},
'asbk': {
'name': 'daap.bookmarkable',
'type': 'ubyte'
},
'aspu': {
'name': 'daap.songpodcasturl',
'type': 'string'
# zero length
},
'aeCR': {
'name': 'com.apple.itunes.content-rating',
'type': 'string'
# zero length
},
'asai': {
'name': 'daap.songalbumid',
'type': 'ulong'
},
'asls': {
'name': 'daap.songlongsize', # in order to support larger than 4G?
'type': 'ulong'
},
'aeHD': {
'name': 'com.apple.itunes.is-hd-video',
'type': 'ubyte'
},
'ceJV': {
'name': 'com.apple.itunes.jukebox-vote',
'type': 'uint'
},
'ceJC': {
'name': 'com.apple.itunes.jukebox-client-vote',
'type': 'ubyte'
},
'ceJS': {
'name': 'com.apple.itunes.jukebox-score',
'type': 'ushort'
},
'aeSE': {
'name': 'com.apple.itunes.store-pers-id',
'type': 'ulong'
},
'aeDV': {
'name': 'com.apple.itunes.drm-versions',
'type': 'uint'
},
'aeDP': {
'name': 'com.apple.itunes.drm-platform-id',
'type': 'uint'
},
'aeDR': {
'name': 'com.apple.itunes.drm-user-id',
'type': 'ulong'
},
'aeND': {
'name': 'com.apple.itunes.non-drm-user-id',
'type': 'ulong'
},
'aeK1': {
'name': 'com.apple.itunes.drm-key1-id',
'type': 'ulong'
},
'aeK2': {
'name': 'com.apple.itunes.drm-key2-id',
'type': 'ulong'
},
'aeXD': {
'name': 'com.apple.itunes.xid',
'type': 'string'
},
'aeMk': {
'name': 'com.apple.itunes.extended-media-kind',
'type': 'uint'
},

# even forked-daapd does not list
'aeMX': {
'name': 'Unknown',
'type': 'string'
},
'aspc': {
'name': 'Unknown',
'type': 'uint'
},
'asri': {
'name': 'Unknown',
'type': 'ulong'
},
'aeCS': {
'name': 'Unknown',
'type': 'uint'
},
'aspl': {
'name': 'Unknown',
'type': 'uint'
},
'askp': {
'name': 'Unknown',
'type': 'uint'
},
'asac': {
'name': 'Unknown',
'type': 'ushort'
},
}

def handler(f, out, tag, size):
if tag not in dmap_tags:
print 'NEW tag:', tag, ', size:', size
return False

item = dmap_tags[tag]
type = item['type']


value = ''
if type == 'ubyte':
value = get_ubyte(f.read(1))
elif type == 'ushort':
value = get_ushort(f.read(2))
elif type == 'uint':
value = get_uint(f.read(4))
elif type == 'ulong':
value = get_ulong(f.read(8))
elif type == 'date':
value = get_date(f.read(4))
elif type == 'string':
value = get_string(f.read(size))
string = 'tag: %s, type: %8s, size:%8d, value: %s' % (tag, type, size, value)
print string
out.write(string + '\n')

return True

def get_string(buffer):
length = len(buffer)
tuple = struct.unpack('%ds' % (length, ), buffer)
return tuple[0]

def get_date(buffer):
tuple = struct.unpack('!I', buffer)
return tuple[0]

def get_ulong(buffer):
tuple = struct.unpack('!Q', buffer)
return tuple[0]

def get_uint(buffer):
tuple = struct.unpack('!I', buffer)
return tuple[0]

def get_ushort(buffer):
tuple = struct.unpack('!H', buffer)
return tuple[0]

def get_ubyte(buffer):
tuple = struct.unpack('B', buffer)
return tuple[0]

def parse(input, output):
f = open(input, 'rb')
out = open(output, 'wb')

count = 0

stat = os.stat(input)
file_size = stat.st_size

while f.tell() < file_size: tag = get_string(f.read(4)) size = get_uint(f.read(4)) ret = handler(f, out, tag, size) if not ret: break f.close() out.close()


輸出結果
tag: mlit, type: list, size: 985, value:
tag: mikd, type: ubyte, size: 1, value: 2
tag: asal, type: string, size: 23, value: Haunted (Bonus Version)
tag: asar, type: string, size: 17, value: Late Night Alumni
tag: asbr, type: ushort, size: 2, value: 320
tag: ascm, type: string, size: 0, value:
tag: asco, type: ubyte, size: 1, value: 0
tag: ascp, type: string, size: 0, value:
tag: asda, type: date, size: 4, value: 1298441625
tag: asdm, type: date, size: 4, value: 1297158494
tag: asdc, type: ushort, size: 2, value: 1
tag: asdn, type: ushort, size: 2, value: 1
tag: aseq, type: string, size: 0, value:
tag: asgn, type: string, size: 10, value: Electronic
tag: asdt, type: string, size: 14, value: MPEG 音訊檔
tag: asrv, type: ubyte, size: 1, value: 0
tag: assr, type: uint, size: 4, value: 44100
tag: assz, type: uint, size: 4, value: 9453988
tag: asst, type: uint, size: 4, value: 0
tag: assp, type: uint, size: 4, value: 0
tag: astm, type: uint, size: 4, value: 233795
tag: astc, type: ushort, size: 2, value: 12
tag: astn, type: ushort, size: 2, value: 3
tag: asur, type: ubyte, size: 1, value: 0
tag: asyr, type: ushort, size: 2, value: 2011
tag: asfm, type: string, size: 3, value: mp3
tag: miid, type: uint, size: 4, value: 321
tag: minm, type: string, size: 11, value: This Is Why
tag: mper, type: ulong, size: 8, value: 15354736237321878078
tag: asdb, type: ubyte, size: 1, value: 0
tag: aeNV, type: uint, size: 4, value: 0
tag: asdk, type: ubyte, size: 1, value: 0
tag: asbt, type: ushort, size: 2, value: 0
tag: agrp, type: string, size: 0, value:
tag: ascd, type: uint, size: 4, value: 1836082535
tag: ascs, type: uint, size: 4, value: 3
tag: aePC, type: ubyte, size: 1, value: 0
tag: asct, type: string, size: 0, value:
tag: ascn, type: string, size: 0, value:
tag: asky, type: string, size: 0, value:
tag: ascr, type: ubyte, size: 1, value: 0
tag: aeHV, type: ubyte, size: 1, value: 0
tag: aeMK, type: ubyte, size: 1, value: 1
tag: aeSN, type: string, size: 0, value:
tag: aeNN, type: string, size: 0, value:
tag: aeEN, type: string, size: 0, value:
tag: aeES, type: uint, size: 4, value: 0
tag: aeSU, type: uint, size: 4, value: 0
tag: aeGH, type: uint, size: 4, value: 1
tag: aeGD, type: uint, size: 4, value: 3264
tag: aeGU, type: ulong, size: 8, value: 10306560
tag: aeGR, type: ulong, size: 8, value: 9343476
tag: aeGE, type: uint, size: 4, value: 576
tag: asgp, type: ubyte, size: 1, value: 0
tag: ased, type: ushort, size: 2, value: 1
tag: ashp, type: ubyte, size: 1, value: 1
tag: assn, type: string, size: 0, value:
tag: assa, type: string, size: 0, value:
tag: assl, type: string, size: 0, value:
tag: assu, type: string, size: 0, value:
tag: assc, type: string, size: 0, value:
tag: asss, type: string, size: 0, value:
tag: asbk, type: ubyte, size: 1, value: 0
tag: aspu, type: string, size: 0, value:
tag: aeCR, type: string, size: 0, value:
tag: asai, type: ulong, size: 8, value: 17360650781560273582
tag: asls, type: ulong, size: 8, value: 9453988
tag: aeHD, type: ubyte, size: 1, value: 0
tag: ceJV, type: uint, size: 4, value: 0
tag: ceJC, type: ubyte, size: 1, value: 0
tag: ceJS, type: ushort, size: 2, value: 0
tag: aeSE, type: ulong, size: 8, value: 0
tag: aeDV, type: uint, size: 4, value: 0
tag: aeDP, type: uint, size: 4, value: 0
tag: aeDR, type: ulong, size: 8, value: 0
tag: aeND, type: ulong, size: 8, value: 0
tag: aeK1, type: ulong, size: 8, value: 0
tag: aeK2, type: ulong, size: 8, value: 0
tag: aeXD, type: string, size: 0, value:
tag: aeMk, type: uint, size: 4, value: 1
tag: aeMX, type: string, size: 0, value:
tag: aspc, type: uint, size: 4, value: 12
tag: asri, type: ulong, size: 8, value: 14899547969766366293
tag: aeCS, type: uint, size: 4, value: 101798
tag: aspl, type: uint, size: 4, value: 1300443947
tag: askp, type: uint, size: 4, value: 0
tag: asac, type: ushort, size: 2, value: 1

2011年3月20日 星期日

dmap field map from forked-daapd

https://github.com/jasonmc/forked-daapd/raw/master/src/httpd_daap.c
static const struct dmap_field dmap_abal = { "abal", "daap.browsealbumlisting", DMAP_TYPE_LIST };
static const struct dmap_field dmap_abar = { "abar", "daap.browseartistlisting", DMAP_TYPE_LIST };
static const struct dmap_field dmap_abcp = { "abcp", "daap.browsecomposerlisting", DMAP_TYPE_LIST };
static const struct dmap_field dmap_abgn = { "abgn", "daap.browsegenrelisting", DMAP_TYPE_LIST };
static const struct dmap_field dmap_abpl = { "abpl", "daap.baseplaylist", DMAP_TYPE_UBYTE };
static const struct dmap_field dmap_abro = { "abro", "daap.databasebrowse", DMAP_TYPE_LIST };
static const struct dmap_field dmap_adbs = { "adbs", "daap.databasesongs", DMAP_TYPE_LIST };
//static const struct dmap_field dmap_aeAD = { "aeAD", "com.apple.itunes.adam-ids-array", DMAP_TYPE_LIST };
static const struct dmap_field dmap_aeAI = { "aeAI", "com.apple.itunes.itms-artistid", DMAP_TYPE_UINT };
static const struct dmap_field dmap_aeCI = { "aeCI", "com.apple.itunes.itms-composerid", DMAP_TYPE_UINT };
//static const struct dmap_field dmap_aeCR = { "aeCR", "com.apple.itunes.content-rating", DMAP_TYPE_STRING };
//static const struct dmap_field dmap_aeDP = { "aeDP", "com.apple.itunes.drm-platform-id", DMAP_TYPE_UINT };
//static const struct dmap_field dmap_aeDR = { "aeDR", "com.apple.itunes.drm-user-id", DMAP_TYPE_ULONG };
//static const struct dmap_field dmap_aeDV = { "aeDV", "com.apple.itunes.drm-versions", DMAP_TYPE_UINT };
static const struct dmap_field dmap_aeEN = { "aeEN", "com.apple.itunes.episode-num-str", DMAP_TYPE_STRING };
static const struct dmap_field dmap_aeES = { "aeES", "com.apple.itunes.episode-sort", DMAP_TYPE_UINT };
//static const struct dmap_field dmap_aeGD = { "aeGD", "com.apple.itunes.gapless-enc-dr", DMAP_TYPE_UINT };
//static const struct dmap_field dmap_aeGE = { "aeGE", "com.apple.itunes.gapless-enc-del", DMAP_TYPE_UINT };
//static const struct dmap_field dmap_aeGH = { "aeGH", "com.apple.itunes.gapless-heur", DMAP_TYPE_UINT };
static const struct dmap_field dmap_aeGI = { "aeGI", "com.apple.itunes.itms-genreid", DMAP_TYPE_UINT };
//static const struct dmap_field dmap_aeGR = { "aeGR", "com.apple.itunes.gapless-resy", DMAP_TYPE_ULONG };
//static const struct dmap_field dmap_aeGU = { "aeGU", "com.apple.itunes.gapless-dur", DMAP_TYPE_ULONG };
//static const struct dmap_field dmap_aeHD = { "aeHD", "com.apple.itunes.is-hd-video", DMAP_TYPE_UBYTE };
static const struct dmap_field dmap_aeHV = { "aeHV", "com.apple.itunes.has-video", DMAP_TYPE_UBYTE };
//static const struct dmap_field dmap_aeK1 = { "aeK1", "com.apple.itunes.drm-key1-id", DMAP_TYPE_ULONG };
//static const struct dmap_field dmap_aeK2 = { "aeK2", "com.apple.itunes.drm-key2-id", DMAP_TYPE_ULONG };
static const struct dmap_field dmap_aeMk = { "aeMk", "com.apple.itunes.extended-media-kind", DMAP_TYPE_UINT };
static const struct dmap_field dmap_aeMK = { "aeMK", "com.apple.itunes.mediakind", DMAP_TYPE_UBYTE };
//static const struct dmap_field dmap_aeND = { "aeND", "com.apple.itunes.non-drm-user-id", DMAP_TYPE_ULONG };
static const struct dmap_field dmap_aeNN = { "aeNN", "com.apple.itunes.network-name", DMAP_TYPE_STRING };
static const struct dmap_field dmap_aeNV = { "aeNV", "com.apple.itunes.norm-volume", DMAP_TYPE_UINT };
static const struct dmap_field dmap_aePC = { "aePC", "com.apple.itunes.is-podcast", DMAP_TYPE_UBYTE };
static const struct dmap_field dmap_aePI = { "aePI", "com.apple.itunes.itms-playlistid", DMAP_TYPE_UINT };
static const struct dmap_field dmap_aePP = { "aePP", "com.apple.itunes.is-podcast-playlist", DMAP_TYPE_UBYTE };
static const struct dmap_field dmap_aePS = { "aePS", "com.apple.itunes.special-playlist", DMAP_TYPE_UBYTE };
//static const struct dmap_field dmap_aeSE = { "aeSE", "com.apple.itunes.store-pers-id", DMAP_TYPE_ULONG };
static const struct dmap_field dmap_aeSF = { "aeSF", "com.apple.itunes.itms-storefrontid", DMAP_TYPE_UINT };
//static const struct dmap_field dmap_aeSG = { "aeSG", "com.apple.itunes.saved-genius", DMAP_TYPE_UBYTE };
static const struct dmap_field dmap_aeSI = { "aeSI", "com.apple.itunes.itms-songid", DMAP_TYPE_UINT };
static const struct dmap_field dmap_aeSN = { "aeSN", "com.apple.itunes.series-name", DMAP_TYPE_STRING };
static const struct dmap_field dmap_aeSP = { "aeSP", "com.apple.itunes.smart-playlist", DMAP_TYPE_UBYTE };
static const struct dmap_field dmap_aeSU = { "aeSU", "com.apple.itunes.season-num", DMAP_TYPE_UINT };
static const struct dmap_field dmap_aeSV = { "aeSV", "com.apple.itunes.music-sharing-version", DMAP_TYPE_UINT };
//static const struct dmap_field dmap_aeXD = { "aeXD", "com.apple.itunes.xid", DMAP_TYPE_STRING };
static const struct dmap_field dmap_agrp = { "agrp", "daap.songgrouping", DMAP_TYPE_STRING };
static const struct dmap_field dmap_aply = { "aply", "daap.databaseplaylists", DMAP_TYPE_LIST };
static const struct dmap_field dmap_aprm = { "aprm", "daap.playlistrepeatmode", DMAP_TYPE_UBYTE };
static const struct dmap_field dmap_apro = { "apro", "daap.protocolversion", DMAP_TYPE_VERSION };
static const struct dmap_field dmap_apsm = { "apsm", "daap.playlistshufflemode", DMAP_TYPE_UBYTE };
static const struct dmap_field dmap_apso = { "apso", "daap.playlistsongs", DMAP_TYPE_LIST };
static const struct dmap_field dmap_arif = { "arif", "daap.resolveinfo", DMAP_TYPE_LIST };
static const struct dmap_field dmap_arsv = { "arsv", "daap.resolve", DMAP_TYPE_LIST };
static const struct dmap_field dmap_asaa = { "asaa", "daap.songalbumartist", DMAP_TYPE_STRING };
static const struct dmap_field dmap_asai = { "asai", "daap.songalbumid", DMAP_TYPE_ULONG };
static const struct dmap_field dmap_asal = { "asal", "daap.songalbum", DMAP_TYPE_STRING };
static const struct dmap_field dmap_asar = { "asar", "daap.songartist", DMAP_TYPE_STRING };
//static const struct dmap_field dmap_asbk = { "asbk", "daap.bookmarkable", DMAP_TYPE_UBYTE };
//static const struct dmap_field dmap_asbo = { "asbo", "daap.songbookmark", DMAP_TYPE_UINT };
static const struct dmap_field dmap_asbr = { "asbr", "daap.songbitrate", DMAP_TYPE_USHORT };
static const struct dmap_field dmap_asbt = { "asbt", "daap.songbeatsperminute", DMAP_TYPE_USHORT };
static const struct dmap_field dmap_ascd = { "ascd", "daap.songcodectype", DMAP_TYPE_UINT };
static const struct dmap_field dmap_ascm = { "ascm", "daap.songcomment", DMAP_TYPE_STRING };
static const struct dmap_field dmap_ascn = { "ascn", "daap.songcontentdescription", DMAP_TYPE_STRING };
static const struct dmap_field dmap_asco = { "asco", "daap.songcompilation", DMAP_TYPE_UBYTE };
static const struct dmap_field dmap_ascp = { "ascp", "daap.songcomposer", DMAP_TYPE_STRING };
static const struct dmap_field dmap_ascr = { "ascr", "daap.songcontentrating", DMAP_TYPE_UBYTE };
static const struct dmap_field dmap_ascs = { "ascs", "daap.songcodecsubtype", DMAP_TYPE_UINT };
static const struct dmap_field dmap_asct = { "asct", "daap.songcategory", DMAP_TYPE_STRING };
static const struct dmap_field dmap_asda = { "asda", "daap.songdateadded", DMAP_TYPE_DATE };
static const struct dmap_field dmap_asdb = { "asdb", "daap.songdisabled", DMAP_TYPE_UBYTE };
static const struct dmap_field dmap_asdc = { "asdc", "daap.songdisccount", DMAP_TYPE_USHORT };
static const struct dmap_field dmap_asdk = { "asdk", "daap.songdatakind", DMAP_TYPE_UBYTE };
static const struct dmap_field dmap_asdm = { "asdm", "daap.songdatemodified", DMAP_TYPE_DATE };
static const struct dmap_field dmap_asdn = { "asdn", "daap.songdiscnumber", DMAP_TYPE_USHORT };
//static const struct dmap_field dmap_asdp = { "asdp", "daap.songdatepurchased", DMAP_TYPE_DATE };
//static const struct dmap_field dmap_asdr = { "asdr", "daap.songdatereleased", DMAP_TYPE_DATE };
static const struct dmap_field dmap_asdt = { "asdt", "daap.songdescription", DMAP_TYPE_STRING };
//static const struct dmap_field dmap_ased = { "ased", "daap.songextradata", DMAP_TYPE_USHORT };
static const struct dmap_field dmap_aseq = { "aseq", "daap.songeqpreset", DMAP_TYPE_STRING };
static const struct dmap_field dmap_asfm = { "asfm", "daap.songformat", DMAP_TYPE_STRING };
static const struct dmap_field dmap_asgn = { "asgn", "daap.songgenre", DMAP_TYPE_STRING };
//static const struct dmap_field dmap_asgp = { "asgp", "daap.songgapless", DMAP_TYPE_UBYTE };
//static const struct dmap_field dmap_ashp = { "ashp", "daap.songhasbeenplayed", DMAP_TYPE_UBYTE };
static const struct dmap_field dmap_asky = { "asky", "daap.songkeywords", DMAP_TYPE_STRING };
static const struct dmap_field dmap_aslc = { "aslc", "daap.songlongcontentdescription", DMAP_TYPE_STRING };
//static const struct dmap_field dmap_asls = { "asls", "daap.songlongsize", DMAP_TYPE_ULONG };
//static const struct dmap_field dmap_aspu = { "aspu", "daap.songpodcasturl", DMAP_TYPE_STRING };
static const struct dmap_field dmap_asrv = { "asrv", "daap.songrelativevolume", DMAP_TYPE_BYTE };
//static const struct dmap_field dmap_assa = { "assa", "daap.sortartist", DMAP_TYPE_STRING };
//static const struct dmap_field dmap_assc = { "assc", "daap.sortcomposer", DMAP_TYPE_STRING };
//static const struct dmap_field dmap_assl = { "assl", "daap.sortalbumartist", DMAP_TYPE_STRING };
//static const struct dmap_field dmap_assn = { "assn", "daap.sortname", DMAP_TYPE_STRING };
static const struct dmap_field dmap_assp = { "assp", "daap.songstoptime", DMAP_TYPE_UINT };
static const struct dmap_field dmap_assr = { "assr", "daap.songsamplerate", DMAP_TYPE_UINT };
//static const struct dmap_field dmap_asss = { "asss", "daap.sortseriesname", DMAP_TYPE_STRING };
static const struct dmap_field dmap_asst = { "asst", "daap.songstarttime", DMAP_TYPE_UINT };
//static const struct dmap_field dmap_assu = { "assu", "daap.sortalbum", DMAP_TYPE_STRING };
static const struct dmap_field dmap_assz = { "assz", "daap.songsize", DMAP_TYPE_UINT };
static const struct dmap_field dmap_astc = { "astc", "daap.songtrackcount", DMAP_TYPE_USHORT };
static const struct dmap_field dmap_astm = { "astm", "daap.songtime", DMAP_TYPE_UINT };
static const struct dmap_field dmap_astn = { "astn", "daap.songtracknumber", DMAP_TYPE_USHORT };
static const struct dmap_field dmap_asul = { "asul", "daap.songdataurl", DMAP_TYPE_STRING };
static const struct dmap_field dmap_asur = { "asur", "daap.songuserrating", DMAP_TYPE_UBYTE };
static const struct dmap_field dmap_asyr = { "asyr", "daap.songyear", DMAP_TYPE_USHORT };
//static const struct dmap_field dmap_ated = { "ated", "daap.supportsextradata", DMAP_TYPE_USHORT };
static const struct dmap_field dmap_avdb = { "avdb", "daap.serverdatabases", DMAP_TYPE_LIST };
//static const struct dmap_field dmap_ceJC = { "ceJC", "com.apple.itunes.jukebox-client-vote", DMAP_TYPE_BYTE };
//static const struct dmap_field dmap_ceJI = { "ceJI", "com.apple.itunes.jukebox-current", DMAP_TYPE_UINT };
//static const struct dmap_field dmap_ceJS = { "ceJS", "com.apple.itunes.jukebox-score", DMAP_TYPE_SHORT };
//static const struct dmap_field dmap_ceJV = { "ceJV", "com.apple.itunes.jukebox-vote", DMAP_TYPE_UINT };
static const struct dmap_field dmap_mbcl = { "mbcl", "dmap.bag", DMAP_TYPE_LIST };
static const struct dmap_field dmap_mccr = { "mccr", "dmap.contentcodesresponse", DMAP_TYPE_LIST };
static const struct dmap_field dmap_mcna = { "mcna", "dmap.contentcodesname", DMAP_TYPE_STRING };
static const struct dmap_field dmap_mcnm = { "mcnm", "dmap.contentcodesnumber", DMAP_TYPE_UINT };
static const struct dmap_field dmap_mcon = { "mcon", "dmap.container", DMAP_TYPE_LIST };
static const struct dmap_field dmap_mctc = { "mctc", "dmap.containercount", DMAP_TYPE_UINT };
static const struct dmap_field dmap_mcti = { "mcti", "dmap.containeritemid", DMAP_TYPE_UINT };
static const struct dmap_field dmap_mcty = { "mcty", "dmap.contentcodestype", DMAP_TYPE_USHORT };
static const struct dmap_field dmap_mdcl = { "mdcl", "dmap.dictionary", DMAP_TYPE_LIST };
//static const struct dmap_field dmap_meds = { "meds", "dmap.editcommandssupported", DMAP_TYPE_UINT };
static const struct dmap_field dmap_miid = { "miid", "dmap.itemid", DMAP_TYPE_UINT };
static const struct dmap_field dmap_mikd = { "mikd", "dmap.itemkind", DMAP_TYPE_UBYTE };
static const struct dmap_field dmap_mimc = { "mimc", "dmap.itemcount", DMAP_TYPE_UINT };
static const struct dmap_field dmap_minm = { "minm", "dmap.itemname", DMAP_TYPE_STRING };
static const struct dmap_field dmap_mlcl = { "mlcl", "dmap.listing", DMAP_TYPE_LIST };
static const struct dmap_field dmap_mlid = { "mlid", "dmap.sessionid", DMAP_TYPE_UINT };
static const struct dmap_field dmap_mlit = { "mlit", "dmap.listingitem", DMAP_TYPE_LIST };
static const struct dmap_field dmap_mlog = { "mlog", "dmap.loginresponse", DMAP_TYPE_LIST };
static const struct dmap_field dmap_mpco = { "mpco", "dmap.parentcontainerid", DMAP_TYPE_UINT };
static const struct dmap_field dmap_mper = { "mper", "dmap.persistentid", DMAP_TYPE_ULONG };
static const struct dmap_field dmap_mpro = { "mpro", "dmap.protocolversion", DMAP_TYPE_VERSION };
static const struct dmap_field dmap_mrco = { "mrco", "dmap.returnedcount", DMAP_TYPE_UINT };
static const struct dmap_field dmap_msal = { "msal", "dmap.supportsautologout", DMAP_TYPE_UBYTE };
static const struct dmap_field dmap_msas = { "msas", "dmap.authenticationschemes", DMAP_TYPE_UINT };
static const struct dmap_field dmap_msau = { "msau", "dmap.authenticationmethod", DMAP_TYPE_UBYTE };
static const struct dmap_field dmap_msbr = { "msbr", "dmap.supportsbrowse", DMAP_TYPE_UBYTE };
static const struct dmap_field dmap_msdc = { "msdc", "dmap.databasescount", DMAP_TYPE_UINT };
static const struct dmap_field dmap_mshl = { "mshl", "dmap.sortingheaderlisting", DMAP_TYPE_UINT };
static const struct dmap_field dmap_mshc = { "mshc", "dmap.sortingheaderchar", DMAP_TYPE_SHORT };
static const struct dmap_field dmap_mshi = { "mshi", "dmap.sortingheaderindex", DMAP_TYPE_UINT };
static const struct dmap_field dmap_mshn = { "mshn", "dmap.sortingheadernumber", DMAP_TYPE_UINT };
static const struct dmap_field dmap_msex = { "msex", "dmap.supportsextensions", DMAP_TYPE_UBYTE };
static const struct dmap_field dmap_msix = { "msix", "dmap.supportsindex", DMAP_TYPE_UBYTE };
static const struct dmap_field dmap_mslr = { "mslr", "dmap.loginrequired", DMAP_TYPE_UBYTE };
static const struct dmap_field dmap_mspi = { "mspi", "dmap.supportspersistentids", DMAP_TYPE_UBYTE };
static const struct dmap_field dmap_msqy = { "msqy", "dmap.supportsquery", DMAP_TYPE_UBYTE };
static const struct dmap_field dmap_msrs = { "msrs", "dmap.supportsresolve", DMAP_TYPE_UBYTE };
static const struct dmap_field dmap_msrv = { "msrv", "dmap.serverinforesponse", DMAP_TYPE_LIST };
//static const struct dmap_field dmap_mstc = { "mstc", "dmap.utctime", DMAP_TYPE_DATE };
static const struct dmap_field dmap_mstm = { "mstm", "dmap.timeoutinterval", DMAP_TYPE_UINT };
//static const struct dmap_field dmap_msto = { "msto", "dmap.utcoffset", DMAP_TYPE_INT };
static const struct dmap_field dmap_msts = { "msts", "dmap.statusstring", DMAP_TYPE_STRING };
static const struct dmap_field dmap_mstt = { "mstt", "dmap.status", DMAP_TYPE_UINT };
static const struct dmap_field dmap_msup = { "msup", "dmap.supportsupdate", DMAP_TYPE_UBYTE };
static const struct dmap_field dmap_mtco = { "mtco", "dmap.specifiedtotalcount", DMAP_TYPE_UINT };
static const struct dmap_field dmap_mudl = { "mudl", "dmap.deletedidlisting", DMAP_TYPE_LIST };
static const struct dmap_field dmap_mupd = { "mupd", "dmap.updateresponse", DMAP_TYPE_LIST };
static const struct dmap_field dmap_musr = { "musr", "dmap.serverrevision", DMAP_TYPE_UINT };
static const struct dmap_field dmap_muty = { "muty", "dmap.updatetype", DMAP_TYPE_UBYTE };

Codes given by content-codes request: http://www.webpages.ttu.edu/mroth/tunes/content-codes.htm

Song Info and Cover Art to Apple TV

在設定音量後,iTunes會以RTSP SET_PARAMETER,告訴Apple TV這首歌的資訊,以及專輯封面
SET_PARAMETER rtsp://192.168.2.72/3383493406 RTSP/1.0
CSeq: 8
Session: 1
Content-Type: application/x-dmap-tagged
Content-Length: 993
RTP-Info: rtptime=3940922067
User-Agent: iTunes/10.2 (Windows; Microsoft Windows 7 Enterprise Edition (Build 7600)) AppleWebKit/533.20.25
Client-Instance: E93468D73F64E796
DACP-ID: E93468D73F64E796
Active-Remote: 3751252212


SET_PARAMETER rtsp://192.168.2.72/3383493406 RTSP/1.0
CSeq: 9
Session: 1
Content-Type: image/jpeg
Content-Length: 101797
RTP-Info: rtptime=3940922067
User-Agent: iTunes/10.2 (Windows; Microsoft Windows 7 Enterprise Edition (Build 7600)) AppleWebKit/533.20.25
Client-Instance: E93468D73F64E796
DACP-ID: E93468D73F64E796
Active-Remote: 3751252212


封面目前看來是直接把embedded cover直接吐出去,還沒測試過如果是embed PNG的話,也是直接吐,還是會做轉換。

2011年3月12日 星期六

TagLib 1.7

TagLib Audio Meta-Data Library
↑網頁好像還沒更新

mailing list裡宣布1.7版release,source control也從KDE SVN跳到github

還沒實際試用過,這次更新從release note來看主要有:
o read/write tags from Monkey's Audio files. 在1.6.3可以讀寫mp3的APE v2 tag,但是沒有支援APE檔。
o read/write embedded pictures from WMA files. 也就是ASF檔的embed cover支援,不過之前有遇到某editor生出來的檔案會有問題
o read/write embedded pictures from FLAC files. 支援了,所以也是得支援@@
o reading WAV audio length. 是的,非常神奇地1.6.3竟然沒有讀WAV檔長度資訊
o removed support for building using autoconf/automake. 要改用CMake

有一個問題還沒做啊…就是ALAC in mp4沒有bitrate, channel資訊

2011年3月5日 星期六

《英雄傳說:零之軌跡》繁體中文PC版本!?

有圖=真相? 萬人期待的日系超人氣大作將改版中文化?@英特衛官網

《英雄傳說:零之軌跡》繁體中文版更宣布預計將於2011年暑假上市!
零之軌跡PC版的開發研製工作更是相當於製作一款全新遊戲:高達150萬字的
破天荒龐大劇情翻譯、將PSP的操作方式重新設計為對應支援、鍵盤、手把等多
種、將原本PSP 480 x 272的遊戲解析度全部重新繪製為高清圖像版本,完工後

的PC版遊戲畫質將大幅超越以往《英雄傳說:空之軌跡》系列呢。

希望到暑假真的會出現,不要跳票啊~

2011年3月4日 星期五

眠れない夜

ただ眠れない…

遠い昔のことを思い出した。たくさんバカなことはやった。でも、ちょっと、いちどだけでもいい。ああいうのはやりたいな