Changeset 403


Ignore:
Timestamp:
15/08/08 15:56:49 (2 years ago)
Author:
stuarth
Message:

Initial support for Windows!

Location:
trunk
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/INSTALL

    r358 r403  
    3939@@HOWTO install@@ 
    4040 
     41 
     42WINDOWS SPECIALS 
     43Must be running the ActiveState perl version (ie run slimserver.pl directly). 
     44 
    4145Copyright © Stuart Hickinbottom 2007-2008 
  • trunk/Makefile

    r402 r403  
    2121 
    2222VERSION=1.0b5 
    23 PERLSOURCE=Plugin.pm Settings.pm Monitor_Linux.pm 
     23PERLSOURCE=Plugin.pm Settings.pm Monitor_Linux.pm Monitor_Windows.pm 
    2424HTMLSOURCE=HTML/EN/plugins/AutoRescan/settings/basic.html 
    2525SOURCE=$(PERLSOURCE) $(HTMLSOURCE) INSTALL strings.txt install.xml LICENSE 
  • trunk/Monitor_Linux.pm

    r402 r403  
    5151        my $invocant = shift; 
    5252        my $class = ref($invocant) || $invocant; 
    53         my $self = { }; 
     53        my $self = { 
     54                poll_each => 0, 
     55        }; 
    5456        bless($self, $class); 
    5557 
  • trunk/Plugin.pm

    r402 r403  
    2626# instructions on the kernel configuration. 
    2727# 
     28# @@TODO@@ 
     29# 
    2830# For further details see: 
    2931# http://www.hickinbottom.com 
     
    3840use utf8; 
    3941use Plugins::AutoRescan::Settings; 
    40 use Plugins::AutoRescan::Monitor_Linux; 
    4142use Slim::Utils::Strings qw (string); 
    4243use Slim::Utils::Timers; 
     
    124125        if ($os eq 'unix') { 
    125126                $log->debug('Linux monitoring method selected'); 
     127                eval 'use Plugins::AutoRescan::Monitor_Linux'; 
    126128                $monitor = Plugins::AutoRescan::Monitor_Linux->new($class); 
    127         } elsif ($os eq 'windows') { 
     129        } elsif ($os eq 'win') { 
    128130                $log->debug('Windows monitoring method selected'); 
    129                 #@@TODO@@ 
     131                eval 'use Plugins::AutoRescan::Monitor_Windows'; 
     132                $monitor = Plugins::AutoRescan::Monitor_Windows->new($class); 
    130133        } else { 
    131134                $log->warn("Unsupported operating system type '$os' - will not monitor for changes"); 
     
    173176} 
    174177 
    175 # Add an inotify watch to the music folder. 
     178# Add a watch to the music folder. 
    176179sub addWatch() { 
    177180        my $audioDir = $serverPrefs->get('audiodir'); 
    178181 
    179182        if (defined $audioDir && -d $audioDir) { 
    180                 $log->debug("Adding inotify monitor to music directory: $audioDir"); 
     183                $log->debug("Adding monitor to music directory: $audioDir"); 
    181184 
    182185                # Add the watch callback. This will also watch all subordinate folders. 
     
    216219                # it's already being monitored later on. 
    217220                $monitors{$dir} = $monitor->addWatch($dir); 
    218         } else { 
    219                 $log->debug("Not adding monitor, one is already present for: $dir"); 
    220221        } 
    221222} 
     
    224225sub poller() { 
    225226 
    226         # Pump that poller - let the monitors decide how to do that. 
    227         $monitor->poll if $monitor; 
     227        # Pump that poller - let the monitors decide how to do that. We support 
     228        # pumping for each monitored directory, or only once in total, depending 
     229        # on what the monitor type wants to do. 
     230        if ($monitor && $monitor->{poll_each}) { 
     231                # Loop through the monitored directories and poll each. 
     232                for my $dir (keys %monitors) { 
     233                        $monitor->poll($dir, $monitors{$dir}); 
     234                } 
     235        } else { 
     236                # Pump the poller once. 
     237                $monitor->poll if $monitor; 
     238        } 
    228239 
    229240        # Flag of whether any rescanning was performed. 
     
    264275                                 
    265276                                delete $touchedDirs{$dir}; 
     277 
     278                                # Make sure we are monitoring any new subdirectories under here. 
     279                                addNotifierRecursive($dir); 
    266280                        } 
    267281                } 
  • trunk/install.xml

    r402 r403  
    4444        </targetApplication> 
    4545 
    46         <targetPlatform>Linux</targetPlatform> 
     46<!--    <targetPlatform>Linux</targetPlatform> --> 
     47<!--    <targetPlatform>Windows</targetPlatform> --> 
    4748</extension> 
Note: See TracChangeset for help on using the changeset viewer.