Skip to content
This repository was archived by the owner on Mar 3, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,54 +6,54 @@
<target name="template_default" depends="setup" description="Build template_default">
<property name="template.dir" value="${basedir}/template_default" />
<exec executable="${mtasc.dir}/${mtasc.exe}" failonerror="false">
<arg line="-version 7 -v -strict -main -header 200:20:24
-cp ${basedir}/classes
-swf ${template.dir}/player_mp3.swf
<arg line="-version 7 -v -strict -main -header 200:20:24
-cp ${basedir}/classes
-swf ${template.dir}/player_mp3.swf
${template.dir}/TemplateDefault.as"/>
</exec>
</target>

<target name="template_mini" depends="setup" description="Build template_mini">
<property name="template.dir" value="${basedir}/template_mini" />
<exec executable="${mtasc.dir}/${mtasc.exe}" failonerror="false">
<arg line="-version 7 -v -strict -main -header 200:20:24
-cp ${basedir}/classes
-swf ${template.dir}/player_mp3_mini.swf
<arg line="-version 7 -v -strict -main -header 200:20:24
-cp ${basedir}/classes
-swf ${template.dir}/player_mp3_mini.swf
${template.dir}/TemplateMini.as"/>
</exec>
</target>

<target name="template_maxi" depends="setup" description="Build template_maxi">
<property name="template.dir" value="${basedir}/template_maxi" />
<exec executable="${mtasc.dir}/${mtasc.exe}" failonerror="false">
<arg line="-version 7 -v -strict -main -header 200:20:24
-cp ${basedir}/classes
-swf ${template.dir}/player_mp3_maxi.swf
<arg line="-version 7 -v -strict -main -header 200:20:24
-cp ${basedir}/classes
-swf ${template.dir}/player_mp3_maxi.swf
${template.dir}/TemplateMaxi.as"/>
</exec>
</target>

<target name="template_multi" depends="setup" description="Build template_multi">
<property name="template.dir" value="${basedir}/template_multi" />
<exec executable="${mtasc.dir}/${mtasc.exe}" failonerror="false">
<arg line="-version 7 -v -strict -main -header 200:20:24
-cp ${basedir}/classes
-swf ${template.dir}/player_mp3_multi.swf
<arg line="-version 7 -v -strict -main -header 200:20:24
-cp ${basedir}/classes
-swf ${template.dir}/player_mp3_multi.swf
${template.dir}/TemplateMulti.as"/>
</exec>
</target>

<target name="template_js" depends="setup" description="Build template_js">
<property name="template.dir" value="${basedir}/template_js" />
<exec executable="${mtasc.dir}/${mtasc.exe}" failonerror="false">
<arg line="-version 8 -v -strict -main -header 1:1:24
-cp ${basedir}/classes
-swf ${template.dir}/player_mp3_js.swf
<arg line="-version 8 -v -strict -main -header 1:1:24
-cp ${basedir}/classes
-swf ${template.dir}/player_mp3_js.swf
${template.dir}/TemplateJS.as"/>
</exec>
</target>


<!-- Configuration -->
<target name="setup" depends="os-props,win,not-win" />

Expand All @@ -71,4 +71,4 @@
<property name="mtasc.exe" value="mtasc" />
</target>

</project>
</project>
58 changes: 32 additions & 26 deletions classes/ATemplate.as
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
Version: MPL 1.1

The contents of this file are subject to the Mozilla Public License
Expand All @@ -15,48 +15,52 @@ The Original Code is mp3player (http://code.google.com/p/mp3player/).

The Initial Developer of the Original Code is neolao (neolao@gmail.com).
*/
/**
/**
* Classe abstraite pour un thème
*
* @author neolao <neo@neolao.com>
* @version 0.9 (02/04/2006)
* @license http://creativecommons.org/licenses/by-sa/2.5/
*/
*
* @author neolao <neo@neolao.com>
* @version 0.9 (02/04/2006)
* @license http://creativecommons.org/licenses/by-sa/2.5/
*/
class ATemplate
{
// ------------------------------ VARIABLES --------------------------------
/**
* L'instance du lecteur */
* L'instance du lecteur
*/
public var player:PlayerBasic;
/**
* Les raccourcis clavier */
* Les raccourcis clavier
*/
private var _shortcuts:Array;

/*============================= CONSTRUCTEUR =============================*/
/*========================================================================*/
/**
* Initialisation */
* Initialisation
*/
private function ATemplate()
{
this._shortcuts = new Array();
this._initKey();

if (_global._accProps == undefined) {
_global._accProps = new Object();
}
//_global._accProps.name = "mp3 player";
}
/*======================= FIN = CONSTRUCTEUR = FIN =======================*/
/*========================================================================*/

/*=========================== METHODES PRIVEES ===========================*/
/*========================================================================*/
/**
* Initialisation du gestionnaire de clavier */
* Initialisation du gestionnaire de clavier
*/
private function _initKey()
{
var o:Object = new Object();
o.onKeyUp = this.delegate(this, function()
o.onKeyUp = this.delegate(this, function()
{
if (this._shortcuts[Key.getCode()]) {
this._shortcuts[Key.getCode()]();
Expand All @@ -66,15 +70,17 @@ class ATemplate
}
/**
* Ajouter un raccourci clavier
*
* @param pKeyCode Le code de la touche * @param pFunction La fonction à exécuter */
*
* @param pKeyCode Le code de la touche
* @param pFunction La fonction à exécuter
*/
private function _addShortcut(pKeyCode:Number, pFunction:Function)
{
this._shortcuts[pKeyCode] = pFunction;
}
/*===================== FIN = METHODES PRIVEES = FIN =====================*/
/*========================================================================*/

/*========================== METHODES PUBLIQUES ==========================*/
/*========================================================================*/
/**
Expand Down Expand Up @@ -106,29 +112,29 @@ class ATemplate
*/
public function startLoading()
{

}
/**
* Délégation de fonction
*
*
* @param pTarget La cible
* @param pFunc La fonction
* @return La même fonction avec un scope fixe
*/
public function delegate(pTarget:Object, pFunc:Function):Function
{
var f:Function = function()
var f:Function = function():Object
{
var target = arguments.callee.target;
var func = arguments.callee.func;
var target:String = arguments.callee.target;
var func:Function = arguments.callee.func;
return func.apply(target);
};

f.target = pTarget;
f.func = pFunc;

return f;
}
/*==================== FIN = METHODES PUBLIQUES = FIN ====================*/
/*========================================================================*/
}
}
Binary file modified template_default/player_mp3.swf
Binary file not shown.
Binary file modified template_js/player_mp3_js.swf
Binary file not shown.
Loading