#! /usr/bin/env python
# vim: set fileencoding=utf-8 enc=utf-8 :
#
# 写真、日本語タイトル、サウンド付き SWF ファイルを作る
# 2006/09/29: created new (Shu KONNO)
#-------------------------------------------------------
from ming import SWFMovie
from ming import SWFBitmap
from ming import SWFFont
from ming import SWFText
from ming import SWFSound
from ming import SWF_SOUND_ADPCM_COMPRESSED
from ming import SWF_SOUND_16BITS

movie = SWFMovie()
movie.setDimension(640, 480)

# 写真
photo = SWFBitmap('machi2006-02r.jpg')
movie.add(photo)

# タイトル
font = SWFFont("Mincho.fdb")
text = SWFText()
text.setFont(font)
text.setColor(0x00, 0x00, 0x00, 0xff)
text.setHeight(30)
text.addUTF8String("祭り唄")
item = movie.add(text)
item.moveTo(10, 30)

# サウンド
opt = SWF_SOUND_ADPCM_COMPRESSED | SWF_SOUND_16BITS
sound = SWFSound('machi-05k.adpcm', opt)
movie.startSound(sound);

movie.save("sample.swf")

