My questions come in a few categories:
- Warnings from implementation based on foo_tutorial. What do these mean? There are some casts in the tutorial that I don't understand, and I want to make sure I don't have typos or impementation issues that will cause problems.
- CODEfoobar2000\helpers\win32_dialog.h(103) : warning C4312: 'reinterpret_cast' : conversion from 'LONG' to 'dialog_helper::dialog_modeless_v2 *' of greater size
- CODE: warning C4312: 'reinterpret_cast' : conversion from 'LONG' to 'window_ffverse *' of greater size
- CODE: warning C4244: 'argument' : conversion from 'LONG_PTR' to 'LONG', possible loss of data
- t_font_description from shared library. I'm just learning some of the WinAPI fundamentals, so maybe the fields correspond directly to certain Windows font structures, but I'm using D3DXFont which takes pixel height. As it stands, it looks like some sort of conversion with the current display DPI and the m_height_dpi done manually, or some sort of data extraction using the font handle from create(), is what I need to do, but I haven't found the solution yet. Any hint?
- Using ATL/WTL. I was planning to explore ATL/WTL for internet access functionality, as well as implementing the UI, but ran into an initial hurdle where it seems references to shared.lib functions weren't compatible. Is this expected behavior, or did I get something wrong in my attempt? How painful will it be to implement everything in, for example, foo_tutorial without shared.lib? Is it just u* functions used in your application, or are there many things like t_font_description in shared.h that will impact certain API function usage even without using any u* functions?
- High Time Resolution. I'm going to be looking around some source code for ideas, but perhaps someone could point me in the direction of the simplest way to get high time resolution execution, i.e., get your component's function to be called very often.
I'm trying to get this function code to execute often enough for decent animation:CODE
static_api_ptr_t<play_control> pc;
timeindex = static_cast<millisecond>(1000.0 * pc->playback_get_position());
redraw_window();
BTW, is the initalization of pc a slowdown? Would declaring it static help?
I see on_playback_time, which would be exactly what I could use if it were called atleast every 10 milliseconds (I'd implement some type of quick evaluation to return without rendering if time had changed by a larger interval that allowed good animation) or some such instead of every second.
I see on_playback_dynamic_info, which is either being slowed down by my foobar config, my improper use, or just doesn't have a high time resolution, as it doesn't perform well with the above code inside it. I also see on_playback_dynamic_info_track, which I'm ignoring at the moment since it is listed as being updated less often than dynamic_info, but perhaps I should experiment?
I see on_playback_seek, and have it implemented.
I have other ideas for how to tackle this, but am not sure how to go about them.
Is there some sort of other hook I could place this code into that would be executed more often? I have just begun to know where to even look to find out about hooks in the foobar API, but this is something I plan on looking into.
I don't know how to implement the equivalent of a message loop where I could control my own timing, as things are implemented by on_message and WndProc (as done in the tutorial). Should I experiment to see how often the WndProc calls are made, and try to implement something to render in that function? Is there a Windows API way to attach a timer to send timer events of a certain interval as messages so the message handler would get called more often?
Some sort of solution that fits the above, or answers to some of the above questions that would help me remove the current issue I have with time chunkiness, are things I can implement right now. So how about it?
In terms of future reimplementation, I've thought that implementing a separate thread to handle animation, independent of foobar, and I could just have dynamic_info try to help keep the thread's timing in sync. But this would take quite a lot of work (for me) and things I don't know yet, I believe. I'll be looking into this anyway if I have reason to believe the above solutions are inefficient or performance hogs (even if I can get it to work), but that's a long term plan. However, if you can provide some info, or point me towards some, that makes it easy to understand how to do this, that would be appreciated.
Anyone one up with helping me with some of the above? It would be much appreciated.
