Changeset 12615


Ignore:
Timestamp:
Aug 3, 2011, 3:14:57 AM (10 years ago)
Author:
jordan
Message:

Add a callback to be invoked when the queue starts a torrent.

Location:
trunk/libtransmission
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/peer-mgr.c

    r12607 r12615  
    35733573        for( i=0; i<n; i++ ) {
    35743574            tr_torrent * tor = tr_sessionGetNextQueuedTorrent( session, dir );
    3575             if( tor != NULL )
     3575            if( tor != NULL ) {
    35763576                tr_torrentStartNow( tor );
     3577                if( tor->queue_started_callback != NULL )
     3578                    (*tor->queue_started_callback)( tor );
     3579            }
    35773580        }
    35783581    }
  • trunk/libtransmission/torrent.c

    r12613 r12615  
    33223322    }
    33233323}
     3324
     3325void
     3326tr_torrentSetQueueStartCallback( tr_torrent * torrent, void (*callback)( tr_torrent * ) )
     3327{
     3328    torrent->queue_started_callback = callback;
     3329}
     3330
     3331
  • trunk/libtransmission/torrent.h

    r12611 r12615  
    236236    tr_torrent_idle_limit_hit_func  * idle_limit_hit_func;
    237237    void                            * idle_limit_hit_func_user_data;
     238
     239    void ( * queue_started_callback )( tr_torrent * );
    238240
    239241    bool                       isRunning;
  • trunk/libtransmission/transmission.h

    r12611 r12615  
    809809int  tr_sessionGetQueueStalledMinutes( const tr_session * );
    810810
     811/** @brief Set a callback that is invoked when the queue starts a torrent */
     812void tr_torrentSetQueueStartCallback( tr_torrent * torrent, void (*callback)( tr_torrent * ) );
     813
    811814
    812815/***
Note: See TracChangeset for help on using the changeset viewer.