/[svn]/linuxsampler/trunk/src/Sampler.cpp
ViewVC logotype

Diff of /linuxsampler/trunk/src/Sampler.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1896 by iliev, Mon Feb 16 17:56:50 2009 UTC revision 1897 by persson, Sun May 10 09:31:51 2009 UTC
# Line 3  Line 3 
3   *   LinuxSampler - modular, streaming capable sampler                     *   *   LinuxSampler - modular, streaming capable sampler                     *
4   *                                                                         *   *                                                                         *
5   *   Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck   *   *   Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck   *
6   *   Copyright (C) 2005 - 2008 Christian Schoenebeck                       *   *   Copyright (C) 2005 - 2009 Christian Schoenebeck                       *
7   *                                                                         *   *                                                                         *
8   *   This library is free software; you can redistribute it and/or modify  *   *   This library is free software; you can redistribute it and/or modify  *
9   *   it under the terms of the GNU General Public License as published by  *   *   it under the terms of the GNU General Public License as published by  *
# Line 774  namespace LinuxSampler { Line 774  namespace LinuxSampler {
774          }          }
775      }      }
776    
777    #if defined(WIN32)
778        static HINSTANCE dllInstance = NULL;
779    
780        String Sampler::GetInstallDir() {
781            char buf[MAX_PATH + 1];
782            if (GetModuleFileName(dllInstance, buf, MAX_PATH)) {
783                String s(buf);
784                size_t n = s.rfind('\\');
785                if (n != String::npos) {
786                    return s.substr(0, n);
787                }
788            }
789            return "";
790        }
791    #endif
792  } // namespace LinuxSampler  } // namespace LinuxSampler
793    
794    #if defined(WIN32)
795    extern "C" {
796        BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved)
797        {
798            switch (reason) {
799            case DLL_PROCESS_ATTACH:
800                LinuxSampler::dllInstance = instance;
801                break;
802            }
803            return TRUE;
804        }
805    }
806    #endif

Legend:
Removed from v.1896  
changed lines
  Added in v.1897

  ViewVC Help
Powered by ViewVC