View Single Post
Old 03-12-2013, 05:22 AM   #4043
BenChen
EPUB Metadata ******
BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.
 
Posts: 522
Karma: 26874
Join Date: Dec 2010
Device: Kobo Glo HD
Quote:
Originally Posted by delf View Post
I mean how I can play sound file from my application?
in Browse Folders, i can found only creation of Node for folders and files(also browsing function doOpenSongHere,oldPlaySongCallback,newDoGotoFirstS ong,..)
How can i play sound file from Path?
As far as I know, it is all done with nodes. To play an mp3, you create an audio node, and then you activate the node.

It may be possible to do it directly, though it is unexplored territory. Here's some functions from the 650's kbook file (which should be pretty much the same as the 950's one):

Code:
	this.kbook.model.playSong = function (node) {
		var parent, i, c, model, view, indexs, menu, index;
		<global>.kbook.movieData.setData(null);
		if (this.currentSong) {
			this.currentSong.unlockPath();
		}
		this.currentSong = node;
		node.lockPath();
		this.SONG = node.media.title;
		this.ARTIST = node.media.artist;
		this.ALBUM = node.media.album;
		parent = node.parent;
		i = parent.shuffleList.getPlayIndex(parent.getIndex(node)) + 1;
		c = parent.length;
		this.SONG_INDEX_COUNT = i + 'fskin:/l/strings/STR_UI_PARTS_OF'.idToString() + c;
		this.container.sandbox.control = 1;
		this.container.sandbox.volumeVisibilityChanged();
		node.media.load(node.cache, this, this.playSongCallback);
		this.changed();
		model = <global>.kbook.model;
		view = null;
		indexs = null;
		if (model.STATE == 'MENU' && if (model.getCurrentDeleteNode() || model.editingNodeListFlag) {) {
			menu = this.container.findContent('MENU');
			view = menu.sandbox.detailsView;
			indexs = view.getSelectedIndexs();
		}
		<global>.kbook.menuData.changed();
		while (indexs) {
			i = 0;
			while (i < indexs.length) {
				index = indexs[i];
				view.setValueToCheckBox(index, true);
				i++;
			}
		}
	};
	this.kbook.model.playSongCallback = function (data) {
		var art, value, firstSongStopFlag;
		if (!data) {
			return;
		}
		<global>.kbook.movieData.setData(data);
		if (this.resumeStartFlg) {
			<global>.kbook.movieData.setTime(this.currentSongPos);
		}
		this.resumeStartFlg = false;
		art = data.getMetaData('AlbumArt');
		if (art) {
			try {
				art = new <global>.Bitmap(art, art.format);
			}
			catch (e)
			{
				art = null;
			}
		}
		<global>.kbook.artData.setData(art);
		this.setVolume();
		value = this.container.getVariable('STANDBY_STATE');
		firstSongStopFlag = this.container.getVariable('FIRST_SONG_STOP_FLAG');
		if (value && !firstSongStopFlag) {
			<global>.kbook.movieData.start();
		}
	};
So it may be possible to set up kbook.movieData and then start it. But the setting up might be quite difficult, and then what happens when you want to stop playback? You might need to use a timer that would activate kbook.movieData.stop(). All that would be extremely difficult, I'm afraid...
BenChen is offline   Reply With Quote