/******************************************************************************

	ams.js
	Andy Knoll - Advanced Media Solutions
	01-21-2012
	
******************************************************************************/


//define the ams "class"
function ams() {
    ams = Class.create(amsWOODApp, {
        initialize: function ($super, objectID, parentObject) {
            //alert("ams app constructor");		
            $super(objectID, parentObject);
            // JS workaround for "is" type checking
            this.imtClass = "ams_1";

            this.title = "ams_1";
            this.author = "Andy Knoll";
            this.date = "Jan 25, 2012";
            this.appVersion = "1.0";
            this.woodVersion = "2.0";

            //alert("ams app constructor done");
        },

        // "override" the getObjectInfo() method
        getObjectInfo: function ($super) {
            var s = $super();
            return s;
        },


        // the three virtual methods which new apps need to override !!!
        // pass in "this" app object as the parent
        // these only need to return an instance of the custom class

        // 01-10-2012 changed creation order to create the views first

        createViewsAs: function () {
            //alert("in ams createViewsAs");
            return new amsViews("views", this); 			// provide a derived class
        },

        createModelsAs: function () {
            //alert("in ams createModelsAs");
            return new amsModels("models", this); 		// provide a derived class
        },

        createControllerAs: function () {
            //alert("in ams createControllerAs");
            return new amsController("controller", this); // provide a derived class
        },




        // override this to false if NOT using screen
        // also comment out the main HTML header
        getIsUsingSplash: function () {
            return false;
        },

        // override this for different splash hold times - default is 1000
        getSplashHoldTime: function () {
            return 1000;
        },

        // override this for different splash fade times - default is 1000
        getSplashFadeTime: function () {
            return 1000;
        },


        // override!!! hook up onCueMessage
        // 01-07-2012 appReady() WOOD 1.4
        runApp: function () {
            //alert("ams.runApp()");

            this.$backDiv.fadeIn(1000); // jQuery call - not a VFXView
            this.views.showFirst();

            this.onCueMessage = this.writeConsole; // above not working - must assign to method?
            this.cueMessage(""); // must write something to flush cue
            this.cueMessage("App started");
            this.cueMessage("");

            this.models.runApp();

            this.writeStatus("App started");
            //alert("ams.runApp() done");
        },

        // 01-12-2012 let the app resolve the main display output methods
        // all other objects in the app will call these

        writeConsole: function (s) {
            //this.views.viewMain.writeConsole(s);
        },

        clearConsole: function () {
            //this.views.viewMain.clearConsole();
        },

        writeStatus: function (s) {
            //this.views.viewMain.writeStatus(s);
        },

        clearStatus: function () {
            //this.views.viewMain.clearStatus();
        }


    });
}

ams();


/*****************************************************************************/

