INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Track Info page, Javascript, & Automation  (Read 1564 times)

cncb

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2918
Track Info page, Javascript, & Automation
« on: October 02, 2010, 09:45:12 am »

I am trying to use javascript and the automation sdk to do some more interesting things with a Track Info page.  I can't seem to connect to the MC instance with the GetObject() javascript call.  It fails with the following error: "Automation server can't create object."  I'm guessing this has something to do with the IE security settings but I can't figure out what needs to be changed.  The same code works in my sidebar gadget which I think uses IE underneath (but perhaps with relaxed security settings).  Any ideas?
Logged
-Craig    MO 4Media remote and player:  Android/TV/Auto | iOS | Windows 10/UWP

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 41932
  • Shoes gone again!
Re: Track Info page, Javascript, & Automation
« Reply #1 on: October 04, 2010, 02:23:32 pm »

I don't know the answer to this.

You could consider a display plugin if you want more flexibility.  With it, you have full control of the window and could show IE, or any custom UI you wanted.  A display plugin is a simple interface that is used to create a window (HWND).

This is the C++ interface definition:
Code: [Select]
#pragma once

/**************************************************************************************************************
JRVisualization

This defines the interface to a JRiver visualization plugin.  The interface is a C++ interface derived from the
class IJRVisualization below.

Export your plugin from a DLL with a single export function CreateVisualization.  You can put any number of visualizations
into a single DLL.  CreateVisualization(...) will be called with the index 0, 1, 2, etc. until a NULL visualization is
returned.

You should also export the functions DllRegisterServer and DllUnregisterServer.  The framework will call these
at install and uninstall time.  For a plugin to appear in the program, it must be registered in the registry
at this location: HKEY_LOCAL_MACHINE\SOFTWARE\JRiver\Media Center 14\Plugins\Display.  To see the format
that is required in the registry, it is recommended that you simply view the stock visualizations that ship with the
program.
**************************************************************************************************************/

/**************************************************************************************************************
Includes
**************************************************************************************************************/
#include "JRVisualizationData.h"

/**************************************************************************************************************
Defines
**************************************************************************************************************/
#define JR_VISUALIZATION_CURRENT_VERSION 3

#define JR_VISUALIZATION_INFO_VERSION _T("Version") // visualization version (return JR_VISUALIZATION_CURRENT_VERSION)
#define JR_VISUALIZATION_INFO_DISPLAY_NAME _T("Display Name") // the display name of the visualization
#define JR_VISUALIZATION_INFO_MODES _T("Modes") // the list of available modes (pipe delimit, use backslashes for nesting)
#define JR_VISUALIZATION_INFO_CURRENT_MODE _T("Current Mode") // the path of the current mode

class IJRVisualization;
class IJRMenu;
class JRMenuInfo;

/**************************************************************************************************************
IJRVisualizationCallback

This interface is provided to a visualization and can be used to get playback information about the currently
playing files.  If you loop the wave or frequency data, get the data pointer with a single call
to GetWaveData(...) or GetFrequencyData(...) and then use the pointer directly instead of calling the functions
again with every iteration of the loop (but get the pointers again with each render cycle).
**************************************************************************************************************/
class IJRVisualizationCallback
{
public:

virtual IJRVisualizationData * JRVisualization_CreateVisualizationData(IJRVisualization * pVisualization) = 0;
};

/**************************************************************************************************************
IJRVisualization
**************************************************************************************************************/
class IJRVisualization
{
public:

// construction / destruction
virtual ~IJRVisualization() { }

// creation
virtual HWND Create(HWND hwndParent, int nZoneID) = 0;

// configuration dialog (can show user interface)
virtual BOOL Options() = 0;

// menu (used for changing presets, presenting user options, etc.)
enum EMenuTypes
{
Menu_Options,
};
virtual BOOL FillMenu(IJRMenu * pMenu, EMenuTypes Type) = 0;
virtual BOOL ProcessMenu(JRMenuInfo * pInfo) = 0;

// settings, etc.
virtual BSTR GetInfo(LPCTSTR pName) = 0;
virtual BOOL SetInfo(LPCTSTR pName, LPCTSTR pValue) = 0;
};

/**************************************************************************************************************
Creation function declaration
**************************************************************************************************************/
typedef IJRVisualization * (*proc_CreateVisualization)(int nIndex, IJRVisualizationCallback * pCallback);
Logged
Matt Ashland, JRiver Media Center

raldo

  • Citizen of the Universe
  • *****
  • Posts: 1102
Re: Track Info page, Javascript, & Automation
« Reply #2 on: October 05, 2010, 01:16:40 am »

Have you tried the js ActiveXObject class?

var obj2 = new ActiveXObject("<mc automation object>");
Logged

cncb

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2918
Re: Track Info page, Javascript, & Automation
« Reply #3 on: October 05, 2010, 08:02:42 am »

I have tried ActiveXObject() and unfortunately get the same error.  I originally started doing a Display plugin which works fine but I wanted to avoid maintaining a separate dll that has to be registered if possible.  If I decide to proceed I guess will just continue with the Display plugin.  Thanks.
Logged
-Craig    MO 4Media remote and player:  Android/TV/Auto | iOS | Windows 10/UWP
Pages: [1]   Go Up