Home AMX User Forum NetLinx Studio

New Module for TP Lists

OK - I should have done this long ago. I'm going to write a module to handle lists on a TP for TV channels, Radio stations, music playlists, movies, etc. Goal is to have this data stored on master CF card instead of baking into code/pages....and to have a decent UI. I'm tired of waiting for fundamental list capability on TP.

I'm trying to think this through before writing code (a new behavior for me), so I've sketched my ideas below. If you have comments, please send along. Even better, if you have CODE, please share. I'll share everything back here.

List can have 1-3 string fields. In any case it will be passed in a 3-field 3d char array.
Field 1 - Name
Field 2 (optionally empty) - Unique index - used for channel numbers, etc
Field 3 - (optionally empty) - Non-unique index 1 - used for category, tag, genre, etc
Field 4 - (optionally empty) - Non-unique index 2 - same

Module parameters include:
char azListArray[][][] - the data
char azFieldName[4][10] - Names of fields for UI
integer iFieldCount - 1-4 depending on whether optional fields are used
char abVisFields[4] - boolean for whether each field is visible in UI (for instance, sat tv music channels are hidden)
char abSortTabs[4] - boolean for whether each tab is sortable via a tab at top of listbox (must be visible to be sortable)
integer iListStyle - list style: traditional list or matrix
...plus UI devs, ports & channels

Functions will include:
LoadList - loads data into one page of list
Filter - filter the list for a search string on a field
Sort - sort list up/down on a particular field
ScrollUp - 1 line
ScrollDn - 1 line
PageUp
PageDn

One question is whether -- instead of passing the data array into the module -- I should simply pass a filename into the module and let the module load the data and "return" a selection. Then any device that delivers metadata realtime can have a sep module that generates the file, rather than populating an array.

I'm guessing I'd have a dfft instance of the mod for each application (Radio station names, satellite tv music chans, video tv chans, music playlist).

Please send comments, ideas, code. I'm hoping to do this just once (ha!)...and as I said, I'll share back...

Comments

  • jjamesjjames Posts: 2,908
    Personally, I'd pass a "file name", except the file name would be a CSV file on the internet somewhere so the module can update itself automatically.

    Perhaps a button to take you to the top of the list and also to the bottom of the list would be helpful. Say I want a channel that starts with "Z", instead of having to page down all the way, I can the hit bottom of page button. Also, what about adding a "search" function. Type in "D", and it lists all the "D" channels, type in "DI", it lists channels starting with "DI" . . . the example I'm thinking of is Discovery, where Disney would also come up until the "c" in Discovery is pressed.

    Just some ideas . . . take it for what it's worth. :D
  • DHawthorneDHawthorne Posts: 4,584
    I've already done something very like this. I made a CSV file with all the pertinent data, and upload it to the master. It can then be refreshed on the fly so the panel reflects the new file data.

    http://www.amxforums.com/showthread.php?t=1958
Sign In or Register to comment.