Sign up here and you can log into the forum!

Getting started with WDTVExt ?

General WDTVExt forum

Re: Getting started with WDTVExt ?   

Postby thespecialist » Sun May 23, 2010 8:20 am

b-rad.cc wrote:I have off today and tommorrow and am going to finally delve into my theories on how to handle this problem.

Ok, I have a bit of time later today, will do some reverse engineering as well.
thespecialist
Developer
 
Posts: 410
Joined: Sat Apr 24, 2010 6:59 am

Re: Getting started with WDTVExt ?   

Postby thespecialist » Sun May 23, 2010 2:11 pm

recliq wrote:I tried this without any success, i think that this is another dmaosd problem... it shows the Folders item only if there is actually a usb device connected..., creating USB1 or 2 doesn't change a thing, so dmaosd must have a look at the mounted usb devices...
I don't think wdtvext can handle this yet in any way... :(

I played around today with my nice new little weapon in my Linux hacking arsenal: GDB :) I modded program flow a bit so that it kept showing the local drive picture after I removed the USB drive. However, if I clicked 'folders' it wouldnt do anything (well actually it did, dmaosd did output an error as debug info). I now understand why: dmaosd makes a 'browse object' for your local drives, first time you click on it. Then if you remove the USB stick, it frees that object and hence the function fails when you try to click it again. So, a little bit research is needed to find out how to make a browse object at boot, for the /tmp/media/usb dir. However, got tons of other stuff to do, so not sure if/when I'll continue with this. Just wanted to share the info.
thespecialist
Developer
 
Posts: 410
Joined: Sat Apr 24, 2010 6:59 am

Re: Getting started with WDTVExt ?   

Postby migube » Wed Jun 09, 2010 12:49 pm

btw, how do you remove existing items from the menu ?
let's say u just want to see the USB folders on the top page ?

tx
-----
WdTvLive - LG BD390 - Philips 47PFL8404h - Yamaha RXV-667 - DM7000 - Synology 107+ - HP Touchpad (Webos)
migube
Global Moderator
 
Posts: 163
Joined: Thu Apr 08, 2010 7:23 am

Re: Getting started with WDTVExt ?   

Postby morbidz » Tue Dec 21, 2010 8:47 am

migube wrote:btw, how do you remove existing items from the menu ?
let's say u just want to see the USB folders on the top page ?

tx

same question. I have wdtv live.
how do I remove everything from the main menu?

I just need to have a link to my xmounted share + youtube.
User avatar
morbidz
Donor
 
Posts: 24
Joined: Tue Sep 14, 2010 4:56 am

Re: Getting started with WDTVExt ?   

Postby recliq » Tue Dec 21, 2010 9:25 am

You can hide all items except Video menu and link Video directly to Folders.

Have a look here. :ugeek:

PS: Hiding of menu items will be supported by next fw release (0.4.5.0)
­WDLXTV Project Maintainer
-:] If you like my contributions feel free to donate for a beer or a new flash drive. ...and always remember: RTFM! (README, FAQ, WIKI) [:-
User avatar
recliq
WDLXTV Team
 
Posts: 5513
Joined: Thu Apr 15, 2010 8:09 am
Location: Kiel, Germany

Re: Getting started with WDTVExt ?   

Postby morbidz » Tue Dec 21, 2010 9:55 am

Would this code work on currently released fw(1.02.21_0.4.3.1) ?

Code: Select all
// GPLv3
/*
# meta-name="HideMenus"
# meta-desc="WDTV OSD Menu Manager"
# meta-author="b-rad.cc"
# meta-date="2010-11-21
# meta-version="0.2.0"
# meta-type="wdtvext"
# meta-url=""
# meta-filename="HideMenus.plugin.js"
*/

traceln("Start loading HideMenus Plugin 0.2.0")
function HideMenusPlugin(path) {
    this.rootPath = path;

    // DEFINES //
    this.VIDEO_NONE =           parseInt("000000000000000",2)
    this.VIDEO_ALL =            parseInt("111111111111111",2)
    this.VIDEO_LOCAL_ALL =      parseInt("100000000000000",2)
    this.VIDEO_LOCAL_DATE =     parseInt("010000000000000",2)
    this.VIDEO_LOCAL_FOLDERS =  parseInt("001000000000000",2)
    this.VIDEO_LOCAL_RECENT =   parseInt("000100000000000",2)
    this.VIDEO_LOCAL_PLAYLIST = parseInt("000010000000000",2)
    this.VIDEO_MSERVERS =       parseInt("000001000000000",2)
    this.VIDEO_NSHARES =        parseInt("000000100000000",2)
    this.VIDEO_YT_FAVORITED =   parseInt("000000010000000",2)
    this.VIDEO_YT_FEATURED =    parseInt("000000001000000",2)
    this.VIDEO_YT_POPULAR =     parseInt("000000000100000",2)
    this.VIDEO_YT_VIEWED =      parseInt("000000000010000",2)
    this.VIDEO_YT_RATED =       parseInt("000000000001000",2)
    this.VIDEO_YT_PREFS =       parseInt("000000000000100",2)
    this.VIDEO_YT_ACCOUNT =     parseInt("000000000000010",2)
    this.VIDEO_YT_SEARCH =      parseInt("000000000000001",2)

    this.MUSIC_NONE =           parseInt("0000000000000",2)
    this.MUSIC_ALL =            parseInt("1111111111111",2)
    this.MUSIC_LOCAL_ALL =      parseInt("1000000000000",2)
    this.MUSIC_LOCAL_ARTIST =   parseInt("0100000000000",2)
    this.MUSIC_LOCAL_GENRE =    parseInt("0010000000000",2)
    this.MUSIC_LOCAL_ALBUM =    parseInt("0001000000000",2)
    this.MUSIC_LOCAL_DATE =     parseInt("0000100000000",2)
    this.MUSIC_LOCAL_FOLDERS =  parseInt("0000010000000",2)
    this.MUSIC_LOCAL_RECENT =   parseInt("0000001000000",2)
    this.MUSIC_LOCAL_PLAYLIST = parseInt("0000000100000",2)
    this.MUSIC_MSERVERS =       parseInt("0000000010000",2)
    this.MUSIC_NSHARES =        parseInt("0000000001000",2)
    this.MUSIC_LIVE365 =        parseInt("0000000000100",2)
    this.MUSIC_SHOUTCAST =      parseInt("0000000000010",2)
    this.MUSIC_PANDORA =        parseInt("0000000000001",2)

    this.PHOTO_NONE =           parseInt("0000000",2)
    this.PHOTO_ALL =            parseInt("1111111",2)
    this.PHOTO_LOCAL_ALL =      parseInt("1000000",2)
    this.PHOTO_LOCAL_DATE =     parseInt("0100000",2)
    this.PHOTO_LOCAL_FOLDERS =  parseInt("0010000",2)
    this.PHOTO_LOCAL_RECENT =   parseInt("0001000",2)
    this.PHOTO_MSERVERS =       parseInt("0000100",2)
    this.PHOTO_NSHARES =        parseInt("0000010",2)
    this.PHOTO_FLICKR =         parseInt("0000001",2)

    this.SETTINGS_NONE =    parseInt("0000000",2)
    this.SETTINGS_ALL =     parseInt("1111111",2)
    this.SETTINGS_AV =      parseInt("1000000",2)
    this.SETTINGS_VIDEO =   parseInt("0100000",2)
    this.SETTINGS_PHOTO =   parseInt("0010000",2)
    this.SETTINGS_MUSIC =   parseInt("0001000",2)
    this.SETTINGS_FILEM =   parseInt("0000100",2)
    this.SETTINGS_NETWORK = parseInt("0000010",2)
    this.SETTINGS_SYSTEM =  parseInt("0000001",2)

    // settings //
        this.Pandora = getConfigSetting("PANDORA")
    this.VIDEO = getConfigSetting("HIDE_VIDEO")
    if (this.VIDEO == "") {
        this.VIDEO = this.VIDEO_NONE
    }
    this.MUSIC = getConfigSetting("HIDE_MUSIC")
    if (this.MUSIC == "") {
        this.MUSIC = this.MUSIC_NONE
    }
    this.PHOTO = getConfigSetting("HIDE_PHOTO")
    if (this.PHOTO == "") {
        this.PHOTO = this.PHOTO_NONE
    }
    this.SETTINGS = getConfigSetting("HIDE_SETTINGS")
    if (this.SETTINGS == "") {
        this.SETTINGS = this.SETTINGS_NONE
    }
}

// chain HideMenusPlugin with proper inheritance - classical in javascript
HideMenusPlugin.prototype = new Plugin()
HideMenusPlugin.prototype.constructor = HideMenusPlugin;

HideMenusPlugin.prototype.doBuildMenus = function() {
    if ((this.VIDEO & this.VIDEO_ALL) == this.VIDEO_ALL) {
        Menu.Top["$$Video"].visible = false
    } else if (this.VIDEO == this.VIDEO_NONE) {
        Menu.Top["$$Video"].visible = true
    } else {
        if ((this.VIDEO & this.VIDEO_LOCAL_ALL) == this.VIDEO_LOCAL_ALL) {
            Menu.Top["$$Video"]["$$Local Drives"]["$$All Video"].visible = false
        }
        if ((this.VIDEO & this.VIDEO_LOCAL_DATE) == this.VIDEO_LOCAL_DATE) {
            Menu.Top["$$Video"]["$$Local Drives"]["$$Date"].visible = false
        }
        if ((this.VIDEO & this.VIDEO_LOCAL_FOLDERS) == this.VIDEO_LOCAL_FOLDERS) {
           Menu.Top["$$Video"]["$$Local Drives"]["$$Folders"].visible = false
        }
        if ((this.VIDEO & this.VIDEO_LOCAL_RECENT) == this.VIDEO_LOCAL_RECENT) {
            Menu.Top["$$Video"]["$$Local Drives"]["$$Recent"].visible = false
        }
        if ((this.VIDEO & this.VIDEO_LOCAL_PLAYLIST) == this.VIDEO_LOCAL_PLAYLIST) {
            Menu.Top["$$Video"]["$$Local Drives"]["$$Playlist"].visible = false
        }
        if ((this.VIDEO & this.VIDEO_MSERVERS) == this.VIDEO_MSERVERS) {
            Menu.Top["$$Video"]["$$Media Servers"].visible = false
        }
        if ((this.VIDEO & this.VIDEO_NSHARES) == this.VIDEO_NSHARES) {
            Menu.Top["$$Video"]["$$Network Shares"].visible = false
        }
        if ((this.VIDEO & this.VIDEO_YT_FAVORITED) == this.VIDEO_YT_FAVORITED) {
            Menu.Top["$$Video"]["$$YouTube"]["$$Top Favorited"].visible = false
        }
        if ((this.VIDEO & this.VIDEO_YT_FEATURED) == this.VIDEO_YT_FEATURED) {
            Menu.Top["$$Video"]["$$YouTube"]["$$Featured Videos"].visible = false
        }
        if ((this.VIDEO & this.VIDEO_YT_POPULAR) == this.VIDEO_YT_POPULAR) {
            Menu.Top["$$Video"]["$$YouTube"]["$$Most Popular"].visible = false
        }
        if ((this.VIDEO & this.VIDEO_YT_VIEWED) == this.VIDEO_YT_VIEWED) {
            Menu.Top["$$Video"]["$$YouTube"]["$$Most Viewed"].visible = false
        }
        if ((this.VIDEO & this.VIDEO_YT_RATED) == this.VIDEO_YT_RATED) {
            Menu.Top["$$Video"]["$$YouTube"]["$$Top Rated"].visible = false
        }
        if ((this.VIDEO & this.VIDEO_YT_PREFS) == this.VIDEO_YT_PREFS) {
            Menu.Top["$$Video"]["$$YouTube"]["$$Preferences"].visible = false
        }
        if ((this.VIDEO & this.VIDEO_YT_ACCOUNT) == this.VIDEO_YT_ACCOUNT) {
            Menu.Top["$$Video"]["$$YouTube"]["$$Account"].visible = false
        }
        if ((this.VIDEO & this.VIDEO_YT_SEARCH) == this.VIDEO_YT_SEARCH) {
            Menu.Top["$$Video"]["$$YouTube"]["$$Search"].visible = false
        }
    }

    if ((this.MUSIC & this.MUSIC_ALL) == this.MUSIC_ALL) {
        Menu.Top["$$Music"].visible = false
    } else if (this.MUSIC == this.MUSIC_NONE) {
        Menu.Top["$$Music"].visible = true
    } else {
        if ((this.MUSIC & this.MUSIC_LOCAL_ALL) == this.MUSIC_LOCAL_ALL) {
            Menu.Top["$$Music"]["$$Local Drives"]["$$All Music"].visible = false
        }
        if ((this.MUSIC & this.MUSIC_LOCAL_ARTIST) == this.MUSIC_LOCAL_ARTIST) {
            Menu.Top["$$Music"]["$$Local Drives"]["$$Artist"].visible = false
        }
        if ((this.MUSIC & this.MUSIC_LOCAL_GENRE) == this.MUSIC_LOCAL_GENRE) {
            Menu.Top["$$Music"]["$$Local Drives"]["$$Genre"].visible = false
        }
        if ((this.MUSIC & this.MUSIC_LOCAL_ALBUM) == this.MUSIC_LOCAL_ALBUM) {
            Menu.Top["$$Music"]["$$Local Drives"]["$$Album"].visible = false
        }
        if ((this.MUSIC & this.MUSIC_LOCAL_DATE) == this.MUSIC_LOCAL_DATE) {
            Menu.Top["$$Music"]["$$Local Drives"]["$$Date"].visible = false
        }
        if ((this.MUSIC & this.MUSIC_LOCAL_FOLDERS) == this.MUSIC_LOCAL_FOLDERS) {
            Menu.Top["$$Music"]["$$Local Drives"]["$$Folder"].visible = false
        }
        if ((this.MUSIC & this.MUSIC_LOCAL_RECENT) == this.MUSIC_LOCAL_RECENT) {
            Menu.Top["$$Music"]["$$Local Drives"]["$$Recent"].visible = false
        }
        if ((this.MUSIC & this.MUSIC_LOCAL_PLAYLIST) == this.MUSIC_LOCAL_PLAYLIST) {
            Menu.Top["$$Music"]["$$Local Drives"]["$$Playlist"].visible = false
        }
        if ((this.MUSIC & this.MUSIC_MSERVERS) == this.MUSIC_MSERVERS) {
            Menu.Top["$$Music"]["$$Media Servers"].visible = false
        }
        if ((this.MUSIC & this.MUSIC_NSHARES) == this.MUSIC_NSHARES) {
            Menu.Top["$$Music"]["$$Network Shares"].visible = false
        }
        if ((this.MUSIC & this.MUSIC_LIVE365) == this.MUSIC_LIVE365) {
            Menu.Top["$$Music"]["$$Live365"].visible = false
        }
        if ((this.MUSIC & this.MUSIC_SHOUTCAST) == this.MUSIC_SHOUTCAST) {
            Menu.Top["$$Music"]["$$Shoutcast"].visible = false
        }
            if (this.Pandora == "OFF" || this.Pandora == "Off" || this.Pandora == "off" || this.MUSIC & this.MUSIC_PANDORA == this.MUSIC_PANDORA) {
                Menu.Top["$$Music"]["$$Pandora"].visible = false
        }
    }

    if ((this.PHOTO & this.PHOTO_ALL) == this.PHOTO_ALL) {
        Menu.Top["$$Photos"].visible = false
    } else if (this.PHOTO == this.PHOTO_NONE) {
        Menu.Top["$$Photos"].visible = true
    } else {
        if ((this.PHOTO & this.PHOTO_LOCAL_ALL) == this.PHOTO_LOCAL_ALL) {
            Menu.Top["$$Photos"]["$$Local Drives"]["$$All Photos"].visible = false
        }
        if ((this.PHOTO & this.PHOTO_LOCAL_DATE) == this.PHOTO_LOCAL_DATE) {
            Menu.Top["$$Photos"]["$$Local Drives"]["$$Date"].visible = false
        }
        if ((this.PHOTO & this.PHOTO_LOCAL_FOLDERS) == this.PHOTO_LOCAL_FOLDERS) {
            Menu.Top["$$Photos"]["$$Local Drives"]["$$Folders"].visible = false
        }
        if ((this.PHOTO & this.PHOTO_LOCAL_RECENT) == this.PHOTO_LOCAL_RECENT) {
            Menu.Top["$$Photos"]["$$Local Drives"]["$$Recent"].visible = false
        }
        if ((this.PHOTO & this.PHOTO_MSERVERS) == this.PHOTO_MSERVERS) {
            Menu.Top["$$Photos"]["$$Media Servers"].visible = false
        }
        if ((this.PHOTO & this.PHOTO_NSHARES) == this.PHOTO_NSHARES) {
            Menu.Top["$$Photos"]["$$Network Shares"].visible = false
        }
        if ((this.PHOTO & this.PHOTO_FLICKR) == this.PHOTO_FLICKR) {
            Menu.Top["$$Photos"]["$$Flickr"].visible = false
        }
    }

    if ((this.SETTINGS & this.SETTINGS_ALL) == this.SETTINGS_ALL) {
        Menu.Top["$$Settings"].visible = false
    } else if (this.SETTINGS  == this.SETTINGS_NONE) {
        Menu.Top["$$Settings"].visible = true
    } else {
        if ((this.SETTINGS & this.SETTINGS_AV) == this.SETTINGS_AV) {
            Menu.Top["$$Settings"]["$$Audio/Video"].visible = false
        }
        if ((this.SETTINGS & this.SETTINGS_VIDEO) == this.SETTINGS_VIDEO) {
            Menu.Top["$$Settings"]["$$Video Setting"].visible = false
        }
        if ((this.SETTINGS & this.SETTINGS_PHOTO) == this.SETTINGS_PHOTO) {
            Menu.Top["$$Settings"]["$$Photo Setting"].visible = false
        }
        if ((this.SETTINGS & this.SETTINGS_MUSIC) == this.SETTINGS_MUSIC) {
            Menu.Top["$$Settings"]["$$Music Setting"].visible = false
        }
        if ((this.SETTINGS & this.SETTINGS_FILEM) == this.SETTINGS_FILEM) {
            Menu.Top["$$Settings"]["$$File Management"].visible = false
        }
        if ((this.SETTINGS & this.SETTINGS_NETWORK) == this.SETTINGS_NETWORK) {
            Menu.Top["$$Settings"]["$$Network Setting"].visible = false
        }
        if ((this.SETTINGS & this.SETTINGS_SYSTEM) == this.SETTINGS_SYSTEM) {
            Menu.Top["$$Settings"]["$$System Setting"].visible = false
        }
    }
}

// create our plugin with baseParg pointing to current script path
// global variables scriptName, scriptLocation and scriptFullPath are available, no need to do the following
HideMenusPlugin.instance = new HideMenusPlugin(scriptPath)

// register our plugin with Ext
Plugin.registerPlugin(HideMenusPlugin.instance)
traceln("End loading HideMenus Plugin")
User avatar
morbidz
Donor
 
Posts: 24
Joined: Tue Sep 14, 2010 4:56 am

Re: Getting started with WDTVExt ?   

Postby morbidz » Fri Dec 24, 2010 5:37 am

So the plugin loads , but I can't figure out how to activate any of the options :(

morbidz wrote:Would this code work on currently released fw(1.02.21_0.4.3.1) ?

Code: Select all
// GPLv3
/*
# meta-name="HideMenus"
# meta-desc="WDTV OSD Menu Manager"
# meta-author="b-rad.cc"
# meta-date="2010-11-21
# meta-version="0.2.0"
# meta-type="wdtvext"
# meta-url=""
# meta-filename="HideMenus.plugin.js"
*/

traceln("Start loading HideMenus Plugin 0.2.0")
function HideMenusPlugin(path) {
    this.rootPath = path;

    // DEFINES //
    this.VIDEO_NONE =           parseInt("000000000000000",2)
    this.VIDEO_ALL =            parseInt("111111111111111",2)
    this.VIDEO_LOCAL_ALL =      parseInt("100000000000000",2)
    this.VIDEO_LOCAL_DATE =     parseInt("010000000000000",2)
    this.VIDEO_LOCAL_FOLDERS =  parseInt("001000000000000",2)
    this.VIDEO_LOCAL_RECENT =   parseInt("000100000000000",2)
    this.VIDEO_LOCAL_PLAYLIST = parseInt("000010000000000",2)
    this.VIDEO_MSERVERS =       parseInt("000001000000000",2)
    this.VIDEO_NSHARES =        parseInt("000000100000000",2)
    this.VIDEO_YT_FAVORITED =   parseInt("000000010000000",2)
    this.VIDEO_YT_FEATURED =    parseInt("000000001000000",2)
    this.VIDEO_YT_POPULAR =     parseInt("000000000100000",2)
    this.VIDEO_YT_VIEWED =      parseInt("000000000010000",2)
    this.VIDEO_YT_RATED =       parseInt("000000000001000",2)
    this.VIDEO_YT_PREFS =       parseInt("000000000000100",2)
    this.VIDEO_YT_ACCOUNT =     parseInt("000000000000010",2)
    this.VIDEO_YT_SEARCH =      parseInt("000000000000001",2)

    this.MUSIC_NONE =           parseInt("0000000000000",2)
    this.MUSIC_ALL =            parseInt("1111111111111",2)
    this.MUSIC_LOCAL_ALL =      parseInt("1000000000000",2)
    this.MUSIC_LOCAL_ARTIST =   parseInt("0100000000000",2)
    this.MUSIC_LOCAL_GENRE =    parseInt("0010000000000",2)
    this.MUSIC_LOCAL_ALBUM =    parseInt("0001000000000",2)
    this.MUSIC_LOCAL_DATE =     parseInt("0000100000000",2)
    this.MUSIC_LOCAL_FOLDERS =  parseInt("0000010000000",2)
    this.MUSIC_LOCAL_RECENT =   parseInt("0000001000000",2)
    this.MUSIC_LOCAL_PLAYLIST = parseInt("0000000100000",2)
    this.MUSIC_MSERVERS =       parseInt("0000000010000",2)
    this.MUSIC_NSHARES =        parseInt("0000000001000",2)
    this.MUSIC_LIVE365 =        parseInt("0000000000100",2)
    this.MUSIC_SHOUTCAST =      parseInt("0000000000010",2)
    this.MUSIC_PANDORA =        parseInt("0000000000001",2)

    this.PHOTO_NONE =           parseInt("0000000",2)
    this.PHOTO_ALL =            parseInt("1111111",2)
    this.PHOTO_LOCAL_ALL =      parseInt("1000000",2)
    this.PHOTO_LOCAL_DATE =     parseInt("0100000",2)
    this.PHOTO_LOCAL_FOLDERS =  parseInt("0010000",2)
    this.PHOTO_LOCAL_RECENT =   parseInt("0001000",2)
    this.PHOTO_MSERVERS =       parseInt("0000100",2)
    this.PHOTO_NSHARES =        parseInt("0000010",2)
    this.PHOTO_FLICKR =         parseInt("0000001",2)

    this.SETTINGS_NONE =    parseInt("0000000",2)
    this.SETTINGS_ALL =     parseInt("1111111",2)
    this.SETTINGS_AV =      parseInt("1000000",2)
    this.SETTINGS_VIDEO =   parseInt("0100000",2)
    this.SETTINGS_PHOTO =   parseInt("0010000",2)
    this.SETTINGS_MUSIC =   parseInt("0001000",2)
    this.SETTINGS_FILEM =   parseInt("0000100",2)
    this.SETTINGS_NETWORK = parseInt("0000010",2)
    this.SETTINGS_SYSTEM =  parseInt("0000001",2)

    // settings //
        this.Pandora = getConfigSetting("PANDORA")
    this.VIDEO = getConfigSetting("HIDE_VIDEO")
    if (this.VIDEO == "") {
        this.VIDEO = this.VIDEO_NONE
    }
    this.MUSIC = getConfigSetting("HIDE_MUSIC")
    if (this.MUSIC == "") {
        this.MUSIC = this.MUSIC_NONE
    }
    this.PHOTO = getConfigSetting("HIDE_PHOTO")
    if (this.PHOTO == "") {
        this.PHOTO = this.PHOTO_NONE
    }
    this.SETTINGS = getConfigSetting("HIDE_SETTINGS")
    if (this.SETTINGS == "") {
        this.SETTINGS = this.SETTINGS_NONE
    }
}

// chain HideMenusPlugin with proper inheritance - classical in javascript
HideMenusPlugin.prototype = new Plugin()
HideMenusPlugin.prototype.constructor = HideMenusPlugin;

HideMenusPlugin.prototype.doBuildMenus = function() {
    if ((this.VIDEO & this.VIDEO_ALL) == this.VIDEO_ALL) {
        Menu.Top["$$Video"].visible = false
    } else if (this.VIDEO == this.VIDEO_NONE) {
        Menu.Top["$$Video"].visible = true
    } else {
        if ((this.VIDEO & this.VIDEO_LOCAL_ALL) == this.VIDEO_LOCAL_ALL) {
            Menu.Top["$$Video"]["$$Local Drives"]["$$All Video"].visible = false
        }
        if ((this.VIDEO & this.VIDEO_LOCAL_DATE) == this.VIDEO_LOCAL_DATE) {
            Menu.Top["$$Video"]["$$Local Drives"]["$$Date"].visible = false
        }
        if ((this.VIDEO & this.VIDEO_LOCAL_FOLDERS) == this.VIDEO_LOCAL_FOLDERS) {
           Menu.Top["$$Video"]["$$Local Drives"]["$$Folders"].visible = false
        }
        if ((this.VIDEO & this.VIDEO_LOCAL_RECENT) == this.VIDEO_LOCAL_RECENT) {
            Menu.Top["$$Video"]["$$Local Drives"]["$$Recent"].visible = false
        }
        if ((this.VIDEO & this.VIDEO_LOCAL_PLAYLIST) == this.VIDEO_LOCAL_PLAYLIST) {
            Menu.Top["$$Video"]["$$Local Drives"]["$$Playlist"].visible = false
        }
        if ((this.VIDEO & this.VIDEO_MSERVERS) == this.VIDEO_MSERVERS) {
            Menu.Top["$$Video"]["$$Media Servers"].visible = false
        }
        if ((this.VIDEO & this.VIDEO_NSHARES) == this.VIDEO_NSHARES) {
            Menu.Top["$$Video"]["$$Network Shares"].visible = false
        }
        if ((this.VIDEO & this.VIDEO_YT_FAVORITED) == this.VIDEO_YT_FAVORITED) {
            Menu.Top["$$Video"]["$$YouTube"]["$$Top Favorited"].visible = false
        }
        if ((this.VIDEO & this.VIDEO_YT_FEATURED) == this.VIDEO_YT_FEATURED) {
            Menu.Top["$$Video"]["$$YouTube"]["$$Featured Videos"].visible = false
        }
        if ((this.VIDEO & this.VIDEO_YT_POPULAR) == this.VIDEO_YT_POPULAR) {
            Menu.Top["$$Video"]["$$YouTube"]["$$Most Popular"].visible = false
        }
        if ((this.VIDEO & this.VIDEO_YT_VIEWED) == this.VIDEO_YT_VIEWED) {
            Menu.Top["$$Video"]["$$YouTube"]["$$Most Viewed"].visible = false
        }
        if ((this.VIDEO & this.VIDEO_YT_RATED) == this.VIDEO_YT_RATED) {
            Menu.Top["$$Video"]["$$YouTube"]["$$Top Rated"].visible = false
        }
        if ((this.VIDEO & this.VIDEO_YT_PREFS) == this.VIDEO_YT_PREFS) {
            Menu.Top["$$Video"]["$$YouTube"]["$$Preferences"].visible = false
        }
        if ((this.VIDEO & this.VIDEO_YT_ACCOUNT) == this.VIDEO_YT_ACCOUNT) {
            Menu.Top["$$Video"]["$$YouTube"]["$$Account"].visible = false
        }
        if ((this.VIDEO & this.VIDEO_YT_SEARCH) == this.VIDEO_YT_SEARCH) {
            Menu.Top["$$Video"]["$$YouTube"]["$$Search"].visible = false
        }
    }

    if ((this.MUSIC & this.MUSIC_ALL) == this.MUSIC_ALL) {
        Menu.Top["$$Music"].visible = false
    } else if (this.MUSIC == this.MUSIC_NONE) {
        Menu.Top["$$Music"].visible = true
    } else {
        if ((this.MUSIC & this.MUSIC_LOCAL_ALL) == this.MUSIC_LOCAL_ALL) {
            Menu.Top["$$Music"]["$$Local Drives"]["$$All Music"].visible = false
        }
        if ((this.MUSIC & this.MUSIC_LOCAL_ARTIST) == this.MUSIC_LOCAL_ARTIST) {
            Menu.Top["$$Music"]["$$Local Drives"]["$$Artist"].visible = false
        }
        if ((this.MUSIC & this.MUSIC_LOCAL_GENRE) == this.MUSIC_LOCAL_GENRE) {
            Menu.Top["$$Music"]["$$Local Drives"]["$$Genre"].visible = false
        }
        if ((this.MUSIC & this.MUSIC_LOCAL_ALBUM) == this.MUSIC_LOCAL_ALBUM) {
            Menu.Top["$$Music"]["$$Local Drives"]["$$Album"].visible = false
        }
        if ((this.MUSIC & this.MUSIC_LOCAL_DATE) == this.MUSIC_LOCAL_DATE) {
            Menu.Top["$$Music"]["$$Local Drives"]["$$Date"].visible = false
        }
        if ((this.MUSIC & this.MUSIC_LOCAL_FOLDERS) == this.MUSIC_LOCAL_FOLDERS) {
            Menu.Top["$$Music"]["$$Local Drives"]["$$Folder"].visible = false
        }
        if ((this.MUSIC & this.MUSIC_LOCAL_RECENT) == this.MUSIC_LOCAL_RECENT) {
            Menu.Top["$$Music"]["$$Local Drives"]["$$Recent"].visible = false
        }
        if ((this.MUSIC & this.MUSIC_LOCAL_PLAYLIST) == this.MUSIC_LOCAL_PLAYLIST) {
            Menu.Top["$$Music"]["$$Local Drives"]["$$Playlist"].visible = false
        }
        if ((this.MUSIC & this.MUSIC_MSERVERS) == this.MUSIC_MSERVERS) {
            Menu.Top["$$Music"]["$$Media Servers"].visible = false
        }
        if ((this.MUSIC & this.MUSIC_NSHARES) == this.MUSIC_NSHARES) {
            Menu.Top["$$Music"]["$$Network Shares"].visible = false
        }
        if ((this.MUSIC & this.MUSIC_LIVE365) == this.MUSIC_LIVE365) {
            Menu.Top["$$Music"]["$$Live365"].visible = false
        }
        if ((this.MUSIC & this.MUSIC_SHOUTCAST) == this.MUSIC_SHOUTCAST) {
            Menu.Top["$$Music"]["$$Shoutcast"].visible = false
        }
            if (this.Pandora == "OFF" || this.Pandora == "Off" || this.Pandora == "off" || this.MUSIC & this.MUSIC_PANDORA == this.MUSIC_PANDORA) {
                Menu.Top["$$Music"]["$$Pandora"].visible = false
        }
    }

    if ((this.PHOTO & this.PHOTO_ALL) == this.PHOTO_ALL) {
        Menu.Top["$$Photos"].visible = false
    } else if (this.PHOTO == this.PHOTO_NONE) {
        Menu.Top["$$Photos"].visible = true
    } else {
        if ((this.PHOTO & this.PHOTO_LOCAL_ALL) == this.PHOTO_LOCAL_ALL) {
            Menu.Top["$$Photos"]["$$Local Drives"]["$$All Photos"].visible = false
        }
        if ((this.PHOTO & this.PHOTO_LOCAL_DATE) == this.PHOTO_LOCAL_DATE) {
            Menu.Top["$$Photos"]["$$Local Drives"]["$$Date"].visible = false
        }
        if ((this.PHOTO & this.PHOTO_LOCAL_FOLDERS) == this.PHOTO_LOCAL_FOLDERS) {
            Menu.Top["$$Photos"]["$$Local Drives"]["$$Folders"].visible = false
        }
        if ((this.PHOTO & this.PHOTO_LOCAL_RECENT) == this.PHOTO_LOCAL_RECENT) {
            Menu.Top["$$Photos"]["$$Local Drives"]["$$Recent"].visible = false
        }
        if ((this.PHOTO & this.PHOTO_MSERVERS) == this.PHOTO_MSERVERS) {
            Menu.Top["$$Photos"]["$$Media Servers"].visible = false
        }
        if ((this.PHOTO & this.PHOTO_NSHARES) == this.PHOTO_NSHARES) {
            Menu.Top["$$Photos"]["$$Network Shares"].visible = false
        }
        if ((this.PHOTO & this.PHOTO_FLICKR) == this.PHOTO_FLICKR) {
            Menu.Top["$$Photos"]["$$Flickr"].visible = false
        }
    }

    if ((this.SETTINGS & this.SETTINGS_ALL) == this.SETTINGS_ALL) {
        Menu.Top["$$Settings"].visible = false
    } else if (this.SETTINGS  == this.SETTINGS_NONE) {
        Menu.Top["$$Settings"].visible = true
    } else {
        if ((this.SETTINGS & this.SETTINGS_AV) == this.SETTINGS_AV) {
            Menu.Top["$$Settings"]["$$Audio/Video"].visible = false
        }
        if ((this.SETTINGS & this.SETTINGS_VIDEO) == this.SETTINGS_VIDEO) {
            Menu.Top["$$Settings"]["$$Video Setting"].visible = false
        }
        if ((this.SETTINGS & this.SETTINGS_PHOTO) == this.SETTINGS_PHOTO) {
            Menu.Top["$$Settings"]["$$Photo Setting"].visible = false
        }
        if ((this.SETTINGS & this.SETTINGS_MUSIC) == this.SETTINGS_MUSIC) {
            Menu.Top["$$Settings"]["$$Music Setting"].visible = false
        }
        if ((this.SETTINGS & this.SETTINGS_FILEM) == this.SETTINGS_FILEM) {
            Menu.Top["$$Settings"]["$$File Management"].visible = false
        }
        if ((this.SETTINGS & this.SETTINGS_NETWORK) == this.SETTINGS_NETWORK) {
            Menu.Top["$$Settings"]["$$Network Setting"].visible = false
        }
        if ((this.SETTINGS & this.SETTINGS_SYSTEM) == this.SETTINGS_SYSTEM) {
            Menu.Top["$$Settings"]["$$System Setting"].visible = false
        }
    }
}

// create our plugin with baseParg pointing to current script path
// global variables scriptName, scriptLocation and scriptFullPath are available, no need to do the following
HideMenusPlugin.instance = new HideMenusPlugin(scriptPath)

// register our plugin with Ext
Plugin.registerPlugin(HideMenusPlugin.instance)
traceln("End loading HideMenus Plugin")
User avatar
morbidz
Donor
 
Posts: 24
Joined: Tue Sep 14, 2010 4:56 am

Re: Getting started with WDTVExt ?   

Postby emmjott » Sat Oct 01, 2011 8:49 am

Hey guys, i came to wonder about the first line of code, which is provided with the plugin skeleton:
Code: Select all
// all traces both trace and traceln will output in /tmp/dmaosd.log (or /tmp/wdtvext.log)
traceln("Plugin.qlPlay: Start loading qlPlay-0.1")

Shouldn't the call to traceln be terminated by a semicolon?

All in all i'm a little confused, as my JavaScript-coding times were a few years ago, but i remember terminating nearly everything with a semicolon. I also could see, that some calls (for example in Reloader plugin) are semicolon-terminated, others aren't.. :geek:

What is the right way?
emmjott
n00b
 
Posts: 5
Joined: Wed Sep 07, 2011 6:41 am

Re: Getting started with WDTVExt ?   

Postby dentex » Sat Oct 01, 2011 9:51 am

Semicolon are optional.

See http://mislav.uniqpath.com/2010/05/semicolons/ for further.

ciao.
User avatar
dentex
Supporter
 
Posts: 179
Joined: Fri Apr 15, 2011 4:57 am
Location: Italy

Previous

Return to WDTVExt discussion

Who is online

Users browsing this forum: No registered users and 2 guests