Project

General

Profile

main2.cc.diff

Jim Turner, October 30, 2016 06:06

View differences:

main.cc 2016-10-29 23:58:12.482736514 -0500
39 39
#include <libaudcore/plugins.h>
40 40
#include <libaudcore/runtime.h>
41 41
#include <libaudgui/libaudgui.h>
42
#include <libaudcore/playlist.h>
42 43

  
43 44
#include "actions-mainwin.h"
44 45
#include "actions-playlist.h"
......
80 81
    void draw (cairo_t * cr);
81 82
    bool button_press (GdkEventButton * event);
82 83
    bool scroll (GdkEventScroll * event);
84
    bool motion (GdkEventMotion * event);  // JWT:ADDED NEXT 5 FOR POPUP SONG INFO:
85
    bool leave ();
86
    int m_playlist = -1;
87
    int m_popup_pos = -1;
88
    QueuedFunc m_popup_timer;
83 89
};
84 90

  
85 91
Window * mainwin;
......
91 97
SkinnedVis * mainwin_vis;
92 98
SmallVis * mainwin_svis;
93 99

  
100
static bool infopopup_on = false;
94 101
static bool seeking = false;
95 102
static int seek_start, seek_time;
96 103

  
......
503 510
    return Window::button_press (event);
504 511
}
505 512

  
513
/* JWT:ADDED NEXT TWO FOR POPUP SONG INFO: */
514
bool MainWindow::motion (GdkEventMotion * event)
515
{
516
    int mousex = event->x;
517
    if (is_shaded ())
518
    {
519
        if (mousex > 62 && mousex < 164)
520
        {
521
            if (aud_get_bool (nullptr, "show_filepopup_for_tuple"))
522
            {
523
                m_playlist = aud_playlist_get_active ();
524
                m_popup_pos = aud_playlist_get_position (m_playlist);
525
                audgui_infopopup_hide ();
526

  
527
                if (m_popup_pos >= 0)
528
                {
529
                    auto show_cb = [] (void * me_) {
530
                        auto me = (MainWindow *) me_;
531
                        audgui_infopopup_show (me->m_playlist, me->m_popup_pos);
532
                    };
533
                    m_popup_timer.queue (aud_get_int (nullptr, "filepopup_delay") * 100, show_cb, this);
534
                    infopopup_on = true;
535
                }
536
            }
537
        }
538
        else if (infopopup_on)
539
        {
540
            m_popup_pos = -1;
541
            m_popup_timer.stop ();
542
            audgui_infopopup_hide ();
543
            infopopup_on = false;
544
        }
545
    }
546
    return Window::motion (event);
547
}
548

  
549
bool MainWindow::leave ()
550
{
551
    if (infopopup_on)
552
    {
553
        m_popup_pos = -1;
554
        m_popup_timer.stop ();
555
        audgui_infopopup_hide ();
556
        infopopup_on = false;
557
    }
558

  
559
    return true;
560
}
561

  
506 562
static void mainwin_playback_rpress (Button * button, GdkEventButton * event)
507 563
{
508 564
    menu_popup (UI_MENU_PLAYBACK, event->x_root, event->y_root, false, false,