Beispiel #1
0
//==========================================================================
void free_free_draw_rectangle(int fdid)
{
    if(!is_free_draw_rectangle(fdid)) return;
    TrackSceneNode* tsn;
    CoreSection* cs;
    tsn = get_scene_track( freedrawvec[fdid]->track);
    cs = get_track_section( tsn, freedrawvec[fdid]->section );

    if( cs )
        detach_free_draw_from_section( cs, fdid );
    else if( tsn )
        detach_free_draw_from_track( tsn, fdid );
    else
        detach_free_draw_from_scene( fdid );

    delete freedrawvec[fdid];
    freedrawvec[fdid] = NULL;
}
Beispiel #2
0
//==========================================================================
void render_free_draw(int fdid)
{
    try 
    {
#ifdef DEBUG
        printf("render_free_draw called %%%%%%%%%%%\n");
#endif
        if( !is_free_draw_rectangle(fdid)) return;
        if( !is_free_draw_visible(fdid)) return;

        PluginFreeDrawRectangle *pfdr = freedrawvec[fdid];

#ifdef DEBUG
        printf("PFDR Data:\nPlugin %d\nX: %f\tY: %f\n", pfdr->plugin,
               pfdr->x, pfdr->y);
        printf("W: %f\tH: %f\n", pfdr->w, pfdr->h);
#endif

        JNIEnv*   jenv = get_current_jnienv();
        if( !jenv ) return;

#ifdef DEBUG
        else printf("JNIEnv Yay\n");
#endif

        jobject   pmo  = get_plugin_manager_object();
        if( !pmo ) { printf("NULL PMO\n"); return; }

#ifdef DEBUG
        else printf("PMO Yay %d\n", pmo);
#endif

        jclass    pmc  = get_plugin_manager_class();
        if( !pmc ) { return; }

#ifdef DEBUG
        else printf("PMC Yay %d\n", pmc);
#endif

        jmethodID pmm  = get_plugin_manager_get_plugin();
        if( !pmm ) {  return; }

#ifdef DEBUG
        else printf("PMM Yay %d\n", pmm);
#endif

        jobject   cpo  = jenv->CallObjectMethod( pmo, pmm, 
                                                 pfdr->plugin);
        if( !cpo ) {  return; }

#ifdef DEBUG
        else printf("CPO Yay\n");
#endif

        jclass    cpc  = jenv->GetObjectClass(cpo);
        if( !cpc ) { return; }

#ifdef DEBUG
        else printf("CPC Yay\n");
#endif

        jmethodID cpm  = jenv->GetMethodID( cpc, "renderRectangle",
                                            "(IIIIFFFFF)V");
        if( !cpm ) { return; }
#ifdef DEBUG
        else printf("CPM Yay\n");

        printf("Calling object method!!!\n");
        fflush(stdout);
#endif
        
        int cur_canvas = get_current_canvas();

        // if the track id and section id != -1 then set the 
        // width as the the width of the section image scaled for the
        // canvas

        CoreSection *cs = get_track_section(get_scene_track(pfdr->track),
                                                pfdr->section);
        
        jenv->CallObjectMethod( cpo, cpm, fdid, cur_canvas,
                                pfdr->track, pfdr->section, 
                                pfdr->x, pfdr->y, pfdr->w, pfdr->h,
                                get_canvas_height(cur_canvas) /
                                get_canvas_orig_height(cur_canvas));
        
#ifdef DEBUG
        printf("Called Object Method!!!!\n");
#endif

    }
    catch( ... )
    {
        printf("Something very strange!\n");
    }
}